item.scopedSlots = { customRender: 'single_icon' };
<template slot="single_icon" slot-scope="text, record, index">
xxx
</template>
这样写,但是没办法获得当前的字段名
item.scopedSlots = { customRender: 'single_icon' };
<template slot="single_icon" slot-scope="text, record, index">
xxx
</template>
这样写,但是没办法获得当前的字段名
template slot="single_icon" slot-scope="text, record, index">
slot-scope中一共有四个有效参数
text:这个字段的值
record:这一行的数据
index:这一行数据在这一页表数据数组中的id
第四个参数:是个对象里面的dataIndex属性对应columns字段设置中的dataIndex
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答4.7k 阅读✓ 已解决
4 回答4.3k 阅读✓ 已解决
4 回答1.9k 阅读✓ 已解决
2 回答2.6k 阅读✓ 已解决
2 回答2.5k 阅读✓ 已解决
xxx 改为{{text}} {{record}} {{index}}看有没有你要的数据