pro-components
pro-components copied to clipboard
🐛[BUG]proformselect的params为函数时不起作用
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🐛 bug 描述
proformselect的params定义为函数或对象,但是当params为函数时,不起作用
params?: ((record: Entity, column: ProSchema<Entity, ExtraProps>) => Record<string, any>) | Record<string, any>;
📷 复现步骤
{
dataIndex: 'select',
label: 'select',
valueType: 'select',
params: { timestamp: Math.random() },
request: async (params) => {
console.log('params', params);
}
}
时,params为{timestamp:xxxx},且能触发request的重新请求。
{
dataIndex: 'select',
label: 'select',
valueType: 'select',
params: () => ({ timestamp: Math.random() }),
request: async (params) => {
console.log('params', params);
}
}
时params为空,且request未重新请求。
🏞 期望结果
当params为函数时,params不为空且能触发request的重新请求。
💻 复现代码
© 版本信息
- ProComponents 版本: 2.6.49
- umi 版本
- 浏览器环境
- 开发环境 [e.g. mac OS]
🚑 其他信息
以下的 Issues 可能会帮助到你 / The following issues may help you
- [#8692][🐛[BUG]proformselect的params为函数时,不起作用][97%]