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 can I use multiple, or parameterized baseurl? #2693

Closed
sarkiroka opened this issue Apr 4, 2019 · 1 comment
Closed

How can I use multiple, or parameterized baseurl? #2693

sarkiroka opened this issue Apr 4, 2019 · 1 comment

Comments

@sarkiroka
Copy link

sarkiroka commented Apr 4, 2019

What problem does this feature solve?

I have a page with many many (near 100) routes, and every route depends on a parameter. So my router config something like that:

base: '/static'
...
path: '/:productId/x' -> for module x
path: '/:productId/y' -> for module y
...
Can I use the base for store parameter?
For example something like this:

base: '/static/:productId'
...
path: '/x' -> for module x
path: '/y' -> for module y
...
Because less code less errors :)

What does the proposed API look like?

{
...
base: '/static/:productId'
...
}
@posva
Copy link
Member

posva commented Apr 4, 2019

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.


You can have a parent route with children and set it's component option to a component that just renders it children

{ path: '/:param', component: { render: h => h('RouterView') }, children: [] }

@posva posva closed this as completed Apr 4, 2019
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