prop 是单向绑定的:当父组件的属性变化时,将传导给子组件,但是不会反过来。这是为了防止子组件无意修改了父组件的状态——这会让应用的数据流难以理解
另外,每次父组件更新时,子组件的所有 prop 都会更新为最新值。这意味着不应该在子组件内部改变 prop。如果这么做了,Vue 会在控制台给出警告
<RadioBoxs
:options_Property="eventcategorys"
v-model="eventparams"
></RadioBoxs>
watch: {
eventxzparams: {
handler(val) {
this.getcategoryTree();
},
deep: true,
},
eventflparams:{
handler(val) {
this.eventparams = this.eventflparams
},
deep: true,
},
eventparams:{
handler(val) {
this.$store.dispatch('STORAGE_EVENT',this.eventparams)
},
deep: true,
}
},