美文网首页
Element UI checkbox 使用 key 绑定

Element UI checkbox 使用 key 绑定

作者: 董懂同学 | 来源:发表于2019-08-05 12:49 被阅读0次
<el-checkbox-group v-model="languageForm.language" @change="onChange">
        <div v-for="item in languageOptions" :key="item.key">
                <el-checkbox :label="item.key" name="language">@{{item.title}}</el-checkbox>
        </div>
</el-checkbox-group>

 languageOptions: [
                    {
                        key: 'cn',
                        title: '简体中文',
                        flag: 'http://www.nanodream.net/public/images/flag/cn.gif'
                    },
                    {
                        key: 'en',
                        title: '英语',
                        flag: 'http://www.nanodream.net/public/images/flag/en.gif'
                    },
                    {
                        key: 'fa',
                        title: '波斯语',
                        flag: 'http://www.nanodream.net/public/images/flag/fa.gif'
                    },
                    {
                        key: 'ar',
                        title: '阿拉伯语',
                        flag: 'http://www.nanodream.net/public/images/flag/ar.gif'
                    },
                    {
                        key: 'ms',
                        title: '马来语',
                        flag: 'http://www.nanodream.net/public/images/flag/ms.gif'
                    },
                    {
                        key: 'bn',
                        title: '孟加拉语',
                        flag: 'http://www.nanodream.net/public/images/flag/bn.gif'
                    },
                    {
                        key: 'ur',
                        title: '乌尔都语',
                        flag: 'http://www.nanodream.net/public/images/flag/ur.gif'
                    },
                    {
                        key: 'tr',
                        title: '土耳其语',
                        flag: 'http://www.nanodream.net/public/images/flag/tr.gif'
                    },
                    {
                        key: 'id',
                        title: '印尼语',
                        flag: 'http://www.nanodream.net/public/images/flag/id.gif'
                    }
                ],

相关文章

网友评论

      本文标题:Element UI checkbox 使用 key 绑定

      本文链接:https://www.haomeiwen.com/subject/kczpdctx.html