Use vue to make a spa website, but some pages do not require headers and tails, or the headers are slightly different. For example, if you click to log in, you do not need a header and navigation bar. What to do at this time? One method is to make the head and tail components into components, and then import these two components into the required pages, but it feels like the amount of code is too much. Is there any other way besides this?
You can refer to the named view upstairs.
I will send you a router configuration, you will understand it at a glance
main.vue
Write everything in, show it when needed, hide it when not needed?
But isn’t your own method pretty good? The beginning and end are common, and you can load them based on the routing
Is it possible to add a judgment condition and whether to display the head and tail according to the condition? v-if else
Write multi-level routing.
You can consider the named view of vue-route. The specific needs will depend on the business
Follow me if you encounter this problem