-
Notifications
You must be signed in to change notification settings - Fork 23
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
Layout doesn't work when using router.push() #1
Comments
Thanks for filing the issue. |
Here it is Try running I just noticed that this error only happen when I remove the I don't understand why it needs |
As const RouterLayout = createRouterLayout(layout => {
if (layout === 'default') {
layout = 'defaultlayout'
}
return import(`@/layouts/${layout}/index.vue`)
}) |
Actually I already define the layout in It seems like when I |
Because the async component does not resolved in that case, then |
Again, even though the component has FYI: |
Ah, I see your second point. It seems another issue. I'll look into it. |
Ok got it. |
@edmundophie I just fixed this on vue-router-layout side. Please try to install the latest vue-router-layout (v0.1.3). |
Wow @ktsn I can't tell you how much I'm grateful for this fix. One last thing though, how do I authorize the router? Does it work well with vue-router navigation guard feature? |
Yes, Edit: layouts cannot use router navigation guard actually because they are not in routes. |
I have made a custom layout called
HelloLayout.vue
and aHelloWorld.vue
page using it and works fine.But, when I try to redirect to it from another page using
this.$router.push('helloworld')
, it gives error in the console as follow:Looks like it still try to use the default layout.
The text was updated successfully, but these errors were encountered: