我现在如果把v-model设置成store里面的值,但是当我取消选择的时候不起作用,这个怎么解决哈?
<el-checkbox-group v-model="checklist" class="cg-outer">
<el-checkbox v-for="column in this.$store.state.queryTable.tableColumns" :label="column.key">
{{column.title}}
</el-checkbox>
</el-checkbox-group>
data(){
return {
//todo:如何把这里的checklist和store里面的checklist结合在一直显示
checklist: this.$store.state.queryTable.checklists,
}
}
const checklists = ['name','sex','nicename','province','city','phonenum','isAttention','attentionDate','cancelAttentionDate','memo'];
export default {
state:{
checklists
}
}
@PanJiaChen
解决了!!!
https://vuex.vuejs.org/zh-cn/forms.html
我tmd是天才