当前位置: 代码迷 >> 综合 >> ant design vue 表格 table (待更
  详细解决方案

ant design vue 表格 table (待更

热度:24   发布时间:2024-01-18 08:08:52.0

也可以给table标签直接加这个 实现 单元格空值时候 可以放个空字

:transformCellText="({ text, column, record, index }) => text||'空'"

 <a-config-provider :locale="zhCN":transformCellText="({ text, column, record, index }) => text||'空'"><router-view/></a-config-provider>

过滤器:就是筛选

 filters: [

            { text: '全部', value: '' },

            { text: '通过', value: '通过' },

            { text: '拒绝', value: '拒绝' },

            { text: '待处理', value: '待处理' },

          ],

          onFilter: (value, record) => record.condition.indexOf(value) === 0,

部分渲染

前提

scopedSlots: {customRender: 'state'}

  <a slot="action" href="javascript:;" @click="onEdit(record)">查看</a>

   <a slot="action" href="javascript:;" @click="visible = true" >备注</a>

             

排序

  // 排列变化

          onFilter: (value, record) => record.address.indexOf(value) === 0,

          sorter: (a, b) => a.address - b.address,

          //  sorter: (a, b) => a.address.length - b.address.length,

          // 可有可无 还是在这里吧 好像是可以倒转切换的 虽然没有ta 也可以切换

          sortDirections: ['descend', 'ascend'],

  相关解决方案