ant-design-vue的table组件customRender 与 scopedSlots 如何共存?
答案是 不可共存,但是可以在customRender里面写jsx,例如:
{
title: '模块',
dataIndex: 'name',
// scopedSlots: { customRender: 'name' },
customRender: (text, record, index) => {
return {
children: (
<a-checkbox
indeterminate={record.indeterminate}
checked={record.isCheckAllLv2}
vOn:change={(e) => this.onCheckRoleChange(e, index)}
>
{{ text }}
</a-checkbox>
),
attrs: {
rowSpan: 1,
},
}
},
},

本文探讨了在Ant Design Vue的Table组件中,customRender与scopedSlots无法共存的问题。尽管如此,你可以利用jsx在customRender内实现组件渲染。参考链接提供了关于如何在Antd Vue Table中通过customRender方法来渲染其他组件的示例和jsx的语法说明。
https://github.com/vueComponent/ant-design-vue/issues/3424
2419

被折叠的 条评论
为什么被折叠?



