ant design vue table customRender 怎么获得字段名

item.scopedSlots = { customRender: 'single_icon' };

<template slot="single_icon" slot-scope="text, record, index">

xxx

</template>

这样写,但是没办法获得当前的字段名

阅读 14.6k
2 个回答

xxx 改为{{text}} {{record}} {{index}}看有没有你要的数据

新手上路,请多包涵

template slot="single_icon" slot-scope="text, record, index">
slot-scope中一共有四个有效参数
text:这个字段的值
record:这一行的数据
index:这一行数据在这一页表数据数组中的id
第四个参数:是个对象里面的dataIndex属性对应columns字段设置中的dataIndex

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题