引入antd 的 Popconfirm
报错 Uncaught TypeError: Cannot read property 'className' of undefined
如果不用这个组件 代码正常
代码如下
const columns = [
{title: '昵称', dataIndex: 'nickName', key: 'nickName'},
{title: '登录名', dataIndex: 'loginName', key: 'loginName'},
{title: '姓名', dataIndex: 'name', key: 'name', render: (text)=>{text}},
{title: '操作', dataIndex: '', key: 'operation', render: (text)=>(
编辑
okText="Yes"
cancelText="No"
删除
)}
];
<Popconfirm>
- 删除
+ <span>删除</span>
</Popconfirm>
如果您阅读聪明的问题( Quest's Question )会更好。
感觉可以做一层适配,如果 children
不是 ReactElement,就自动包上 span
标签。
在 antd 这一层做适配即可。
我认为与Dropdown
类似的问题
我认为Dropdown也有类似问题
最有用的评论
感觉可以做一层适配,如果
children
不是 ReactElement,就自动包上span
标签。