子组件
<template>
<button @click="change()"></button>
</template>
export default{
name:"child",
data(){
return{
}
},
model:{
prop:'str1',
event:'changeStr1'
},
props:{
str1:{
type:Boolean,
required:true
}
},
methods:{
change(){
this.$emit('changeStr1',!str1)
}
}
}
父组件
<child v-model="str1"/>
.....
data(){
return{
str1:true
}
}