Element: checkbox中使用checkbox-group时, 如何获取id ,而不是label的值?

Created on 23 Nov 2016  ·  2Comments  ·  Source: ElemeFE/element

let positiveTags = [{name: 'xx', id:1}, { name: 'xxx2', id: 2 }, {name: 'xxx3', id: 3}]
<el-checkbox-group v-model="selectedDatas">
    <el-checkbox :label="item.name" v-for="item in positiveTags"></el-checkbox>
</el-checkbox-group>

请问selectedDatas怎样可以拿到选中的id , 而不是 name,
用true-label没用

Most helpful comment

    <el-checkbox-group v-model="selectedDatas">
      <el-checkbox  :label="item.id" v-for="item in positiveTags">{{item.name}}</el-checkbox>
    </el-checkbox-group>

All 2 comments

    <el-checkbox-group v-model="selectedDatas">
      <el-checkbox  :label="item.id" v-for="item in positiveTags">{{item.name}}</el-checkbox>
    </el-checkbox-group>

@QingWei-Li thx!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhguokai picture zhguokai  ·  3Comments

dbskccc picture dbskccc  ·  3Comments

chao-hua picture chao-hua  ·  3Comments

FranzSkuffka picture FranzSkuffka  ·  3Comments

fscardua picture fscardua  ·  3Comments