ant-design-vue
ant-design-vue copied to clipboard
浏览器方式引入antd文件,表格的自定义单元格bodyCell插槽无效
trafficstars
- [ ] I have searched the issues of this repository and believe that this is not a duplicate.
Version
3.2.20
Environment
vue3
Reproduction link
https://raw.githubusercontent.com/zyufstudio/antd3-test/master/index.html
Steps to reproduce
运行页面后,bodyCell插槽自定义单元格无效
What is expected?
bodyCell插槽可以正常自定义单元格
What is actually happening?
bodyCell插槽无效
这是 Vue 在 DOM 内嵌模板中的语法限制,暂时可以用动态插槽来解决。
<template #[body_cell]="{column, text }">
<template v-if="column.dataIndex === 'name'">
<a>name {{ text }}</a>
</template>
</template>
setup(){
return {
body_cell: 'bodyCell'
}
}
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days