Vue.js 烤肉串案例道具上的Vue.sync无法处理更新事件

Vue.js 烤肉串案例道具上的Vue.sync无法处理更新事件,vue.js,Vue.js,我正在尝试编写一个Vue.sync演示。当我使用烤肉串案例道具时,我很困惑,它无法侦听更新事件。像这样 <sync-input v-bind:input-value.sync="message"></sync-input> Vue.component('sync-input',{ props:{ inputValue: String }, template: ` <div> &l

我正在尝试编写一个Vue.sync演示。当我使用烤肉串案例道具时,我很困惑,它无法侦听更新事件。像这样

<sync-input v-bind:input-value.sync="message"></sync-input>

Vue.component('sync-input',{
    props:{
        inputValue: String
    },
    template: `
        <div>
            <label>{{inputValue}}</label>
            <input type="text" v-bind:value="inputValue" v-on:input="$emit('update:input-value', $event.target.value)">
        </div>
    `
})

Vue.component('sync-input'{
道具:{
inputValue:字符串
},
模板:`
{{inputValue}}
`
})
但如果我使用单字道具,它会起作用

<sync-input v-bind:title.sync="message"></sync-input>

Vue.component('sync-input',{
    props:{
        title: String
    },
    template: `
        <div>
            <label>{{title}}</label>
            <input type="text" v-bind:value="title" v-on:input="$emit('update:title', $event.target.value)">
        </div>
    `
})

Vue.component('sync-input'{
道具:{
标题:字符串
},
模板:`
{{title}}
`
})

我的代码有问题吗?或者这是一个bug?

不习惯,只是好奇:如果您试图用烤肉串键定义props对象:
{'input-value':String}
?@Sergeon与用
{'inputValue':String}
{inputValue:String}
定义相同。这个问题还没有解决。我不知道为什么会发生烤肉串的情况,但你可以试试焦糖盒
:inputValue.sync=“/code>@Sølvetraftøe它不起作用。