jeecgboot vue list columns use customRender to realize self-increasing serial number and super long text omission display

JS

 data () {
    
    
      //定义超长文本字符省略方法
      let ellipsis = (v, l = 20) => (<j-ellipsis value={
    
    v} length={
    
    l} />)
       return {
    
    
          // 表头
        columns: [
          {
    
    
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
    
    
              return parseInt(index)+1;
            }
          },
           {
    
    
            title:'结果详情',
            align:"center",
            dataIndex: 'resultInfo',
            customRender: (v) => ellipsis(v)
          },
          ],
  }

Guess you like

Origin blog.csdn.net/weixin_44934104/article/details/126728800
Recommended