0
点赞
收藏
分享

微信扫一扫

vue columns的处理

星河出山 2022-01-06 阅读 34

dataIndex 文本

  {
          title: "title",
          dataIndex: "title",
        },

customRender 插槽:选择性文本

 {
          title: "sex",
          dataIndex: "sex",
          customRender: (text, row, index) => {
            switch (text) {
              case '1':
                return 'male';
              case '0':
                return 'female';
              default:
                return 'unknown';
            }
          }
        },

scopedSlots 传递

       {
          title: "operation",
          dataIndex: 'operation',
          width: "120px",
          fixed: "right",
          scopedSlots: { customRender: 'operation' }
        }
        
        

传递单个column,定义模块 slot接受的值operation

  <template slot="operation" slot-scope="record">
  <a class="edit" @click="() => do(record)">
  点击传递单行column
  </a>   
  </template>
举报

相关推荐

0 条评论