作用: 允许props数据的双向数据绑定 , 不能和表达式一起使用,例如 v-bind:title.sync=”doc.title + ‘!’” 是无效的 复制代码 //子组件 this.$emit('update:title', newTitle) //父组件 <text-document v-bind:title="doc.title" v-on:update:title="doc.title = $event" ></text-docu...
作用: 允许props数据的双向数据绑定 , 不能和表达式一起使用,例如 v-bind:title.sync=”doc.title + ‘!’” 是无效的 复制代码 //子组件 this.$emit('update:title', newTitle) //父组件 <text-document v-bind:title="doc.title" v-on:update:title="doc.title = $event" ></text-docu...