赞
踩
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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。