一、引入
import { h } from 'vue'
二、column属性cellRenderer使用h函数
h函数中嵌套Element组件Popconfirm
{
title: '注释',
width: 165,
flexGrow:1,
key: "str",
dataKey: "str",
cellRenderer: ({ rowData }: any) => {
return [
h("div",
{
style: { display: 'flex', alignItems: "center"}
},
[
h("span", { className: "title" }, `${rowData.str}` ),
h(ElPopconfirm,{
title: "确定 ?",
width: 172,
onConfirm: () => func(rowData),
},{
reference: () => h(Shutdown, { title: '关机'}),
})
]
),
]
}
},
标签:el,函数,title,column,v2,rowData,str
From: https://www.cnblogs.com/wutong-211/p/18546441