B
B
beduin012019-05-07 18:15:36
Vue.js
beduin01, 2019-05-07 18:15:36

Should side menus be moved to components?

With pages, everything is clear.
/components/Index.vue
/components/FAQ.vue
/components/About.vue
But if I need to show a sidebar on all these pages, how can I do it more correctly? Also as a component? If so, what would be its level of hierarchy?
/components/sidebar.vue ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
alex, 2019-05-07
@beduin01

src/components/AppSidebar.vue
src/components/AppFooter.vue

src/pages/Index.vue
src/pages/About.vue

L
lavezzi1, 2019-05-07
@lavezzi1

Deploy the project with vue-cli-3 and see how the vue creators see the project structure.
Pages should be kept separate from components.
src/
-components/
-views/
And yes, we take out all the repeating elements in the components.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question