vue3.0 sync属性变化
.sync使用方法改变
- 带参数的 v-model
- 2.x
- 3.x
- 不带参数的 v-model
- 3.x
export default {
props: {
modelValue: String // 以前是`value:String`
},
emits: ['update:modelValue'],
methods: {
changePageTitle(title) {
this.$emit('update:modelValue', title) // 以前是 `this.$emit('input', title)`
}
}