必ず value という名前で作成しましょう
export default {
props: {
value: {
type: String,
required: true
}
}
}
export default {
computed: {
inputValue: {
get() {
return this.value;
},
set(value) {
this.$emit('input', value);
}
}
} ,
}
<input type="text" v-model="inputValue" />
以上です。
<my-component v-model="item.content.value"></my-component>