Skip to content
New issue

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

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

Open
likang329 opened this issue Jul 15, 2024 · 5 comments
Open

Comments

@likang329
Copy link

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

这是remote端的页面:
微信图片_20240714184201

这是host端的页面:
微信图片_20240714184209

这是remote端的暴露组件:
微信图片_20240714185104

这是host端的引入使用组件:
微信图片_20240714184237
微信图片_20240714184244

@Issues-translate-bot
Copy link

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?

@He110te4m
Copy link

只要 Vue 是同一个 vue , pinia 就能共享,跟模块联邦没关系,是你的 vue 不是同一个,没有 share

@Issues-translate-bot
Copy link

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


As long as Vue is the same vue, Pinia can share it. It has nothing to do with module federation. It's just that your vue is not the same one and there is no share.

@905868332
Copy link

只要 Vue 是同一个 vue , pinia 就能共享,跟模块联邦没关系,是你的 vue 不是同一个,没有 share

我这边是host,引入了remote,想让remote的页面在host里边跑的时候,pinia数据展示的是host的,但是没有效果

@Issues-translate-bot
Copy link

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


As long as Vue is the same vue, Pinia can share it. It has nothing to do with module federation. Your vue is not the same one, so there is no share.

My side is the host, and remote has been introduced. When I want the remote page to run in the host, the pinia data shows the host, but it has no effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants