iveiw table 渲染表头

一、表头加提示

将表头columns.map
            item.renderHeader = h => {
    
    
              return h(
                'Tooltip',
                {
    
    
                  props: {
    
    
                    placement: 'top',
                    theme: 'light',
                    transfer: true,
                    maxWidth: 300,
                    content:
                      '注意:提示内容',
                  },
                },
                [
                  h(
                    'div',
                    {
    
    
                      style: {
    
    
                        cursor: 'pointer',
                        height: '100%',
                        width: '100%',
                        display: 'flex',
                        'align-items': 'center',
                        'justify-content': 'center',
                      },
                    },
                    [item.title, h('span', {
    
     class: 'tip-img' })]
                  ),
                ]
              );
            };

  /deep/ .ivu-table-cell {
    
    
    .tip-img {
    
    
      display: inline-block;
      vertical-align: top;
      margin-left: 6px;
      width: 15px;
      height: 15px;
      background: url('../../../assets/images/passenger-flow/tip.png') no-repeat;
      background-size: contain;
    }
    .tip {
    
    
      white-space: normal;
    }
  }

效果图如下:
在这里插入图片描述
二、排序

猜你喜欢

转载自blog.csdn.net/weixin_43843679/article/details/111665507
今日推荐