originjs / vite-plugin-federation

Module Federation for vite & rollup
Other
2.22k stars 232 forks source link

host端如何使用remote端的pinia中的state里面的数据呢? #612

Open likang329 opened 1 month ago

likang329 commented 1 month ago

我在remote暴露了整个store,想在host端使用,在host端使用remote端中actions写的方法没有问题,但是获取state中的变量值为空,请问我该怎么把remote端的store中的变量都共享呢?

这是remote端的页面:

微信图片_20240714184201

这是host端的页面:

微信图片_20240714184209

这是remote端的暴露组件:

微信图片_20240714185104

这是host端的引入使用组件:

微信图片_20240714184237 微信图片_20240714184244
Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: How does the host side use the data in the state in pinia on the remote side?