Element: 如何把el-checkbox-group的v-model设置成store里面的值

Created on 13 Mar 2017  ·  2Comments  ·  Source: ElemeFE/element

我现在如果把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
    }
}

All 2 comments

@PanJiaChen

解决了!!!
https://vuex.vuejs.org/zh-cn/forms.html
我tmd是天才

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chao-hua picture chao-hua  ·  3Comments

akaylh picture akaylh  ·  3Comments

zhguokai picture zhguokai  ·  3Comments

fscardua picture fscardua  ·  3Comments

EdenSpark picture EdenSpark  ·  3Comments