pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🐛[BUG] ProForm request 不会触发transform

Open fatesq opened this issue 3 years ago • 1 comments
trafficstars

🐛 bug 描述

request的时候ProFormDependency得到的是setFieldsValue的原始数据 手动select触发ProFormDependency得到的是transform变化后的数据

📷 复现步骤

<ProForm request={async()=> { const json = await api() return json }}

<ProFormSelect name="select" fieldProps={{labelInValue: true}} transform={(v)=> ({id: v.value, name: v.label})} /> <ProFormDependency name={['select']}> { (value)=> { console.log(value) } } </ProFormDependency> </ProForm> request 返回值触发ProFormDependency 得到的value是select数据 transform之前的 手动选择 select 触发ProFormDependency 得到的 value 是transform之后的

🏞 期望结果

request 和手动选择select触发ProFormDependency 得到的结果保持一致

💻 复现代码

© 版本信息

  • ProComponents 版本: [e.g. 4.0.0]
  • umi 版本
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息

fatesq avatar Jul 26 '22 01:07 fatesq

request 获取的是intialvalues 怎么会触发 transform?

transform 只有 onchange 的时候才会触发

chenshuai2144 avatar Aug 02 '22 05:08 chenshuai2144