v-model 双向绑定数据,v-model=“data”写在html的表单标签中,计算属性中的函数有get和set的双向绑定数据方法,所以可以将v-model的值作为计算属性中的函数名 computed: { toggleAll: {get() {returnthis.unCompleteCount ===0; },set(stutus) {this.items.forEach(function(v) { v.completed=stutus; })...
{SET_PLANID,SET_PLANLEVEL}from'./../data-base'exportdefault{computed:{planLevel:{get:()=>{returnSAFTY_DATA_BASE.planLevel},set:(value)=>SET_PLANLEVEL(value)}}}//data-base.jsconstSAFTY_DATA_BASE=Vue.observable({planLevel:4,})constSET_PLANLEVEL=(planLevel)=>{SAFTY_DATA...
vue中的计算属性可以绑定为v-model的值() 查看答案
v-model 双向绑定数据,v-model=“data”写在html的表单标签中,计算属性中的函数有get和set的双向绑定数据方法,所以可以将v-model的值作为计算属性中的函数名 computed: { toggleAll: {get() {returnthis.unCompleteCount ===0; },set(stutus) {this.items.forEach(function(v) { v.completed=stutus; })...