ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.3k stars 1.36k forks source link

🧐[问题]ProForm的request怎么触发重新渲染? #3366

Closed Eliot00 closed 3 years ago

Eliot00 commented 3 years ago

🧐 问题描述

我传入ProLayout的tabKey做params,切换tab时确实重新触发了ProForm的request,但是表单项的值没有随着改变。除了切换tab时刷新页面还有其他办法吗?request返回值改变不会触发ProForm重新渲染吗?

💻 示例代码

🚑 其他信息

依赖版本:

  "dependencies": {
    "@ant-design/icons": "^4.0.0",
    "@ant-design/pro-card": "^1.14.3",
    "@ant-design/pro-descriptions": "^1.2.0",
    "@ant-design/pro-form": "^1.31.0",
    "@ant-design/pro-layout": "^6.9.0",
    "@ant-design/pro-table": "^2.17.0",
    "@umijs/route-utils": "^1.0.33",
    "antd": "^4.12.0",
  }
chenshuai2144 commented 3 years ago

有个 params 的设置,params={{key}} 这样好了,每次 params 改变都会重新触发 request

hesetiema commented 2 years ago

我遇到了 formKey 设置为常量,request虽然请求了最新的数据,但 initialData 并未设置进去,去除 formKey 即可。

xw5 commented 1 year ago

修改params,会触发重新request,但是不会触发表单数据更新