H
H
HamSter2019-09-09 18:57:18
Vue.js
HamSter, 2019-09-09 18:57:18

How can I properly organize a vue project with a common layout but a difference in a block?

There is such a mini vue project.
For pages views/Home.vue , views/About.vue, ... there is a common layout/DefaultLayout.vue
But for the Home.vue page, you need the simplest search form in the header, and the About.vue page does not need this form search, but you need, for example, an additional button (any).
Question: How can you implement something like this, pages with a common layout but with a difference in some block?!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-09-09
@HamSter007

In addition to the default slot, you can use as many more named ones as you need. So pass additional content through a separate slot.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question