tsx中写插槽
代码中css引入的unocss,加了自定义命名vue3
本文只是记录tsx的写法,代码运行需要自定义组件(实现tsx写法的组件)
代码片段
<script setup lang='tsx'>
const column: TableColumnProps<Item>[]=[
{
label: '编号',
prop: 'id'
},
{
label:'示例',
render:(row)=> {
const slots = {
reference: () => <div class="vue3-truncate vue3-cursor-pointer">这里在popover中展示的内容,鼠标放上去就可以</div>,
}
return (
<ElPopover v-slots={slots} width="650px" popper-class="poperClass" effect="light">
<span>条码</span>
</ElPopover>
)
}
}
]
</script>
<template>
<NiTable :columns='column' :data='data' />
</template>