We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@umijs/plugin-qiankun 2.44.1 主应用:使用 Ant Design Pro v4 创建的,使用 model 管理数据, 在主应用 app.ts 中使用 useQiankunStateForSlave 同步数据给子应用共享 在子应用中使用@umijs/max 4.2.11 提供的 useModel('@@qiankunStateFromMaster')获取主应用数据
场景:一些用户数据会随着操作(登录/登出/切换用户)变化 问题:如何监听model 管理数据的变化,并将这个变化同步给子应用?
The text was updated successfully, but these errors were encountered:
// src/index.ts import { useModel } from "umi"; function MasterPage() { const { masterState, setMasterState } = useModel("@@qiankunStateForSlave"); return ( <div> <button onClick={() => setMasterState("Hello Qiankun")}> 修改全局 state </button> {masterState} </div> ); }
Sorry, something went wrong.
No branches or pull requests
@umijs/plugin-qiankun 2.44.1
主应用:使用 Ant Design Pro v4 创建的,使用 model 管理数据,
在主应用 app.ts 中使用 useQiankunStateForSlave 同步数据给子应用共享
在子应用中使用@umijs/max 4.2.11 提供的 useModel('@@qiankunStateFromMaster')获取主应用数据
场景:一些用户数据会随着操作(登录/登出/切换用户)变化
问题:如何监听model 管理数据的变化,并将这个变化同步给子应用?
The text was updated successfully, but these errors were encountered: