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

Multiple Params Support #212

Open
ayZagen opened this issue May 2, 2022 · 8 comments
Open

Multiple Params Support #212

ayZagen opened this issue May 2, 2022 · 8 comments
Labels
enhancement New feature or request

Comments

@ayZagen
Copy link

ayZagen commented May 2, 2022

It would be great to have multiple params support in route definitions like vue-router. For ex:

Filename: [slug]-[pid].vue
Matches: myproduct-PID21341

@jd-solanki
Copy link

+1

@leosin
Copy link

leosin commented May 19, 2022

+1
some times the backend which provided api like /wp-json/wc/v3/products/<id>
So I need to get the information of the current post via id,
but at the same time I need to generate a seo url from the slug provided by the post
The current compromise is
product->[id]->[slug].vue

But if new parameters appear again, maybe I have to add another directory
is there a better way, or what did I do wrong in the first place?

@hannoeru hannoeru added the enhancement New feature or request label Jun 17, 2022
@huangyiman
Copy link

+1

2 similar comments
@craines
Copy link

craines commented Aug 18, 2022

+1

@reazan
Copy link

reazan commented Sep 3, 2022

+1

@hschk
Copy link

hschk commented Mar 9, 2023

@leosin Did you find a different solution for this?

I want to have both routes:

  • posts -> [id].vue
  • posts -> [id] -> comments -> [cid].vue

But this does not seem to work, at least not with the following folder structure:

src/pages/
  |___ posts/
       ├── [id].vue
       └── [id]/
            └── comments/
                  |___ [cid].vue

Is there a way to achieve this?

@jbaubree
Copy link
Contributor

jbaubree commented Mar 9, 2023

@hschk you can do this:

src/pages/posts/[id]/
                                    └── index.vue
                                    └── comments/[cid].vue

@hschk
Copy link

hschk commented Mar 9, 2023

@jbaubree That makes sense! Thank you :)

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

No branches or pull requests

9 participants