当前位置:   article > 正文

vue antd table自定义表头_ant design vue 自定义table表头

ant design vue 自定义table表头
        this.columnDetail.push({ // 表头数据
              label: item,
              width,
              dataIndex: "key" + index,
              key: "key" + index,
              scopedSlots: {
                customRender: "space",
                title: "key" + index// 插槽对应  与你下方定义slot对应
              }
            });
            this.customTitleList.push({// 插槽  你想改变的数据
              slot: "key" + index,
              title: item
            });


// 页面
        <!-- 自定义表头内容展示 -->
        <div
          :slot="record.slot"
          v-for="(record, i) in customTitleList"
          :key="i"
        >
          <span v-if="record.title.length < 6">{{ record.title }}</span>
          <a-tooltip placement="topLeft" :title="record.title" v-else>
            <span>{{ record.title.slice(0, 6) + "..." }}</span>
          </a-tooltip>
        </div>
        <!-- 自定义表格内容展示 -->
// 效果图
https://img-blog.csdnimg.cn/83f9b47e01cb42f1811f0f0f590ce2bd.png#pic_center



  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/897048
推荐阅读
相关标签
  

闽ICP备14008679号