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

Pages folder for nothing? #21

Open
lepicekmichal opened this issue Jul 4, 2021 · 3 comments
Open

Pages folder for nothing? #21

lepicekmichal opened this issue Jul 4, 2021 · 3 comments
Labels
question Further information is requested

Comments

@lepicekmichal
Copy link

So, is there a purpose for pages folder now? Besides separation of course.

My point being: is there a way to setup automatic creation by nuxt into modules pages? Or is it something possible and will be made in future?

@MichaelGitArt
Copy link

As you can see here , pages registered manually. import.js and router.js. And I like the idea.

If there are pages in defferent modules, we need create deep nesting to create needed url

pages/store/product/:id
pages

  • store
    --product
    --- _id.vue
    --- list.vue

Folder into folder multiple times. And it's not cool, as for me

@bleto bleto added the question Further information is requested label Jul 7, 2021
@bleto
Copy link
Member

bleto commented Jul 7, 2021

I'm not sure if I understand the question completely, but I will try to answer.

By dividing the project into modules we can have many different routings for a module. The VueMS mechanism needs to see the routing files to link them and add additional mechanisms.
We currently have no plans to implement a mechanism that will dynamically generate routing, but we still want to stick to the convention borrowed from NuxtJS.

As for the structure of the pages directory - this is a structure based on the NuxtJS convention, we didn't modify anything here.

@lepicekmichal
Copy link
Author

lepicekmichal commented Jul 7, 2021

Manual overwrite of routes is fine, but i would still like default automatic creation.
So I am not asking to replace anything, I just don't see the reason for necessary manual routing.

As these two examples are interchangeable as far as generating is concerned:

(original nuxt)

  • pages
    • user
      • id.vue
      • index.vue
    • article
      • id.vue
      • index.vue

(vuems)

  • modules
    • user
      • pages
        • id.vue
        • index.vue
    • article
      • pages
        • id.vue
        • index.vue

I am now playing with my own fork of https://github.com/ktsn/vue-route-generator to make exatly this possible, and so far haven't found a blocking issue. But maybe it is possible and I just can't read your documentation right 😀. Please advise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants