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

How push route params from main-app to sub-app? #34

Open
ilp opened this issue Dec 18, 2020 · 1 comment
Open

How push route params from main-app to sub-app? #34

ilp opened this issue Dec 18, 2020 · 1 comment

Comments

@ilp
Copy link

ilp commented Dec 18, 2020

I have two nuxt applications: main-app and sub-app.
main-app: localhost:3000
sub-app: localhost:3001

In my sub-app I have one route /pages/item/_id.vue that was mapped in main-app.
E.g from main-app: localhost:3000/item/1

When I make this: this.$router.push({ name: 'item', params: { id: 1 } }) from main-app the sub-app get id as undefined.

Can I use router.push or I only have that use vuex to the shared resources between main and sub apps?

@ilp ilp changed the title How push route params from main-app to sub-app How push route params from main-app to sub-app? Dec 18, 2020
@cjfff
Copy link
Contributor

cjfff commented Feb 27, 2021

emmm, because you use the push in main app, the main app don't know the subapp path.

you can image the qiankun in main_app is use you subapp_path to redirect to subapp.

so use the push function in main_app vue-router don't know you think.

solution: you can use the push this.$router.push(/sub-path/item/${id})

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

2 participants