alibaba / x-render

🚴‍♀️ 阿里 - 很易用的中后台「表单 / 表格 / 图表」解决方案
https://xrender.fun
6.91k stars 980 forks source link

使用 table-render的工具栏 toolbarAction 提示错误 不影响使用 但有顾虑 #1511

Open dk-gif opened 3 months ago

dk-gif commented 3 months ago

1.依赖仓库的版本(Dependencies versions)

2.问题描述(Bug description): 浏览器提示 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of DomWrapper3 which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: 3.出现问题的 schema demo(Reproduction schema demo)

toolbarAction

4.最小复现 demo(Reproduction demo): import { useRef } from 'react' import TableRender from 'table-render'

const Demo = () => { const tableRef = useRef()

const columns = [ { title: '酒店名称', // dataIndex 唯一时,可以省略 key dataIndex: 'title', valueType: 'text', width: '20%' }, { title: '酒店地址', dataIndex: 'address', ellipsis: true, copyable: true, valueType: 'text', width: '25%' }, { title: '酒店状态', enum: { open: '营业中', closed: '已打烊' }, dataIndex: 'state' }, { title: '酒店星级', dataIndex: 'labels', width: 90, valueType: 'tags' }, { title: '酒店GMV', sorter: true, dataIndex: 'money', valueType: 'money' }, { title: '成立时间', dataIndex: 'created_at', valueType: 'date' } ]

const searchApi = () => { return undefined }

return ( <TableRender ref={tableRef} scroll={{ x: 1500 }} request={searchApi} columns={columns} pagination={{ pageSize: 2 }} toolbarAction /> ) }

export default Demo

form-render demo https://codesandbox.io/s/unruffled-flower-jl78h table-render demo https://codesandbox.io/s/sweet-euler-bdoty fr-generator demo https://codesandbox.io/s/s13sh