vue-easy-table的rowkey设置及行单选

地址:https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/row-radio

 <ve-table
      style="width:100%"
      :columns="columns"
      :table-data="tableData"
      :radio-option="radioOption"
      row-key-field-name="rowKey" // rowkey为数据源的唯一值,后端给定,或者自己加上去。
    />
``
 tableData: [
          {
            rowKey: 1001,
            name: "John",
            date: "1900-05-20",
            hobby: "coding",
            address: "No.1 Century Avenue, Shanghai",
          },
          {
            rowKey: 1002,
            name: "Dickerson",
            date: "1910-06-20",
            hobby: "coding",
            address: "No.1 Century Avenue, Beijing",
          },
        ],
      };
  

```javascript
 columns: [
 // 三列数据,多一列是单选框,fiedl和title设置为空
          {
            field: "",
            key: "a",
            // type=radio
            type: "radio",
            title: "",
            width: 50,
            align: "center",
          },
          { field: "name", key: "b", title: "Name", width: 200, align: "left" },
          { field: "hobby", key: "c", title: "Hobby", width: 300, align: "left" },
          { field: "address", key: "d", title: "Address", width: "", align: "left" },
上一篇:2021 部署 Hexo 到(新版)CODING Pages 并实现全站 HTTPS 协议


下一篇:git上传本地项目到coding