-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ProTable时DataSource的数据格式不支持string[] #7343
Comments
以下的 Issues 可能会帮助到你 / The following issues may help you
|
很抱歉,由于我是一个文字助手,无法访问链接或执行代码。但是我可以尝试为您提供一些初步的解决方案和文档。请尝试以下步骤来解决ProTable中DataSource数据格式不支持string[]的问题:
const dataSource = [
{ key: '1', value: 'Value 1' },
{ key: '2', value: 'Value 2' },
{ key: '3', value: 'Value 3' },
];
const columns = [
{
title: 'Column 1',
dataIndex: '1',
key: '1',
},
{
title: 'Column 2',
dataIndex: '2',
key: '2',
},
{
title: 'Column 3',
dataIndex: '3',
key: '3',
},
];
<ProTable dataSource={dataSource} columns={columns} /> 这样,您就可以在ProTable中正确显示基于string[]的数据了。 此外,您还可以查看ProTable文档以获取更多关于DataSource和列配置的信息: 请注意,这只是一个初步的解决方案,实际解决问题可能会根据您的具体代码和环境而有所不同。 |
这个方案的确可行,但是这个问题是由于我们升级依赖产生的,目前我们不确定有哪些基础模块有这个问题,所以这种方法不太适合升级,目前已经把依赖切换回低版本确保项目运行,等到官方修复bug再进行升级 |
虽然不是不能用,但是推荐还是不要这么用。这样用起来很容易出问题 |
主要是低版本没问题,如果最开始有问题我们酒不会这么用了 |
🐛 bug 描述
当使用ProTable时DataSource的数据格式为string[]等基础数据类型时会报错,此bug是因为使用了Reflect.has方法导致,此方法不支持基本类型
💻 复现代码
代码示例
The text was updated successfully, but these errors were encountered: