vue-component-router icon indicating copy to clipboard operation
vue-component-router copied to clipboard

A little disconnect goes a long way

Open MVSICA-FICTA opened this issue 8 years ago • 2 comments

From the readme, "It also creates a slight disconnect between your routes and your UI, as if they were two separate things."

IMO I like this disconnect in the official vue-router because the content of routes.js in the vue-router is just a module of functions, specific to routing. They are then invoked with given parameters, so they can also be customized and reused.

Maybe there is such a thing as component/tunnel-vision? In contrast, keeping logic out of components scales better and allows for more compositional possiblities.

MVSICA-FICTA avatar Apr 09 '17 00:04 MVSICA-FICTA

I've been using both vue-router and vue-component-router in different projects and i have to say I really like this continuation of "everything is a component".

This is basically a Vue implementation of react-router 4 and it achieved just that!

If you like to keep your router wholey separate from your components, then stick with the official router library.

I think this just provides a really nice alternative approach. One that I'm sure many people will appreciate!

jackmellis avatar Jul 13 '17 17:07 jackmellis

I far prefer the React Router approach. Having a Route element deciding whether a child component gets rendered is pretty much a logical extension of a v-if on an element, determining whether that element gets rendered based on data. It's a real shame this style of routing isn't an option in the official vue-router. I'm not sure of the quality of this project because it's not "official". :smile:

jez9999 avatar Sep 08 '22 16:09 jez9999