ergonode / vuems

A simple mechanism to transform a monolithic Vue application into an application based on Micro Services architecture
https://vuems.ergonode.com
Open Software License 3.0
78 stars 9 forks source link

Pages folder for nothing? #21

Open lepicekmichal opened 3 years ago

lepicekmichal commented 3 years ago

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 commented 3 years ago

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

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

bleto commented 3 years ago

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 commented 3 years ago

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)

(vuems)

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 :grinning:. Please advise.