来源:https://blog.csdn.net/qq_35858002/article/details/88710244
效果
代码
<Table ref="modalTable":columns="modalColumns" :data="deliveryData" border stripe></Table> data() { return { currentChoose: '', modalColumns: [ { title: '选择', key: 'id', 70, align: 'center', render: (h, params) => { let id = params.row.id; let flag = false; if (this.currentChoose === id) { flag = true } let self = this return h('div', [ h('Radio', { props: { value: flag }, on: { 'on-change': () => { self.currentChoose = id; } } }) ]) } }, {title: '姓名', key: 'name'}, {title: '手机号', key: 'contactPhone'}, ], }}
iView table单选实现
<Table ref="modalTable":columns="modalColumns" :data="deliveryData" border stripe></Table>