We have been using Vue.js at my company for the last few months and we're really liking it! We are using Element UI for the UI and vue-router for routing. Based on the structure of our data, we nest our routes several layers deep. It looks something like this:
App ->
Line ->
Type ->
Component1
Component2
Component3
Our designer would like to be able to control layouts on a per-page basis, even all the way down inside of Component*. For instance, in Component1 there may be a layout with a sidebar and footer and in Component2 there would be no sidebar but the footer would be hidden.
We've found this complicated based on the nested structure. Instead of components showing up as distinct blocks on a page they are nested inside of each other. We could un-nest each Vue route, but then we run the risk of duplicating logic through a lot of the pages that are at the same level.
What's are some good ways to handle layouts in a nested structure such as this?
slotsand whether or not they would be appropriate for your use case?routethat you define in order to control which components appear in the page.