ant table的customRender函数如何返回vue标签?-灵析社区

sumous_01

import { ref, h } from 'vue'; import { Tag } from 'ant-design-vue'; const tag = h(Tag, { color: "blue" }, 'label') function customRender({ value, column }, options) { return tag; } const dataSource = ref([ { a: 1 }, { a: '2,1'}, { a: 3 }, ]) const columns = ref([ { title: '哈哈哈', dataIndex: 'a', customRender, }, ]) [文档地址](https://link.segmentfault.com/?enc=SyxwpblO8lyIhtmwGKs90g%3D%3D.wEU5QDjnHoqTpG5T1niMghXjm316%2FmQkSx99mUChEf0t176%2B18oaqBVSmb%2F5iBIg%2Bmy%2FLtrmD7%2BxyptAGuu9gg%3D%3D) 如何修改呢?

阅读量:303

点赞量:13

问AI
满脑子智慧溢出
const tag = ()=>h(Tag, { color: "blue" }, 'label') function customRender({ value, column }, options) { return tag(); } 这样?有点不太清楚你想干什么 "image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241226/b2291f872d610cfc98e8447197c8d6e7.png)