ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

浏览器方式引入antd文件,表格的自定义单元格bodyCell插槽无效

Open zyufstudio opened this issue 1 year ago • 1 comments
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

Document

运行页面后,bodyCell插槽自定义单元格无效

What is expected?

bodyCell插槽可以正常自定义单元格

What is actually happening?

bodyCell插槽无效

zyufstudio avatar Apr 02 '24 08:04 zyufstudio

这是 Vue 在 DOM 内嵌模板中的语法限制,暂时可以用动态插槽来解决。

<template #[body_cell]="{column, text }">
    <template v-if="column.dataIndex === 'name'">
      <a>name {{ text }}</a>
    </template>
</template>

setup(){
  return {
    body_cell: 'bodyCell'
  }
}

Sight-wcg avatar Apr 16 '24 16:04 Sight-wcg

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

github-actions[bot] avatar Jun 16 '24 02:06 github-actions[bot]