iview viewDesign table 单选 Radio

columns.js

export default [
  {
    title: '选择',
    slot: 'choose',
    align: 'center',
    width: 100
  },

table里面

<template slot="choose"
                  slot-scope="{ row, index }">
          <Radio :value="row.id === chooseId"
                 @on-change="() => chooseId = row.id"></Radio>
        </template>

data数据

data () {
    return {
      chooseId: '',
posted @ 2021-11-08 17:04  彭成刚  阅读(419)  评论(0编辑  收藏  举报