// 父组件
<template>
<div id="app">
<children v-model="flag"></children>
</div>
</template>
<script>
import children from './test/children.vue';
export default {
components: {
children,
},
data() {
return {
flag: true,
}
},
}
</script>
// 子组件
<template>
<div>
<div>{{value}}</div>
<button @click="click">plus-value</button>
</div>
</template>
<script>
export default {
props: ['value'],
methods: {
click() {
this.$emit('input', !this.value);
}
}
}
</script>
1462

被折叠的 条评论
为什么被折叠?



