joeldenning / coexisting-vue-microfrontends

A repo showing separate vue apps coexisting as microfrontends with single-spa
http://coexisting-vue-microfrontends.surge.sh/
MIT License
615 stars 143 forks source link

请问如果需要通过router的name跳转页面,有没有好的解决方案呢?目前是不是只支持path跳转 #37

Closed Monroe123 closed 4 years ago

joeldenning commented 4 years ago

From Bing Translate:

If you need to jump through the router's name jump page, is there a good solution? Currently is not only supporting path jump

@Monroe123 could you provide more detail? I do not understand what "jump through the router's name jump page" means.

Monroe123 commented 4 years ago

I want to jump by this.$router.push({name: xxx, query: {key: value}}), but got an error

joeldenning commented 4 years ago

What error did you get?

mango-csl commented 4 years ago

What error did you get?

i hava a similar doubt

when i commented out this code in ‘root-html-file/index.html’

// 'root-html-file/index.html'

Promise.all([System.import('single-spa'), System.import('vue'), System.import('vue-router')]).then(function (modules) {   
    //var singleSpa = modules[0];
    //var Vue = modules[1];
    //var VueRouter = modules[2];
    //Vue.use(VueRouter)

it will be error to use router in 'navbar/src/App.vue'

this.$router.push('/navbar')
// this.$router   is  undefined

image

but it works in vue-microfrontends[https://github.com/vue-microfrontends]

joeldenning commented 4 years ago

https://github.com/joeldenning/coexisting-vue-microfrontends/issues/37#issuecomment-607659665 is a duplicate of #52

I am closing this issue due to inactivity