element-plus elpopover table在tsx中展示多余文本

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>
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐