A
A
Andrey2021-02-18 01:34:40
Vue.js
Andrey, 2021-02-18 01:34:40

VUE SPA how to override component in layout?

Kind.
VUE SPA
The template has a header. I would like to change the visualization of the header from page to page. But something like a stone flower does not come out.
I try a component - does not redefine from page. Gives an error message.
The only way out that I found is to use a global variable and assign any values ​​to it in the loaded pages. But it seems to me that it would be better to do something differently.
Tell me how to do it right?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mirexdoors, 2021-02-18
@mirexdoors

Well, apparently, you need to use a router . In the routes themselves, pass the parameter that will come to the prop component of the header. and there already depending on it, do what you need.

A
Alexander, 2021-02-19
@UPSA

Better ask why

does not override from the page. Gives an error message.
And keep banging your head against "Dynamic Components".
How to connect button and components?
https://ru.vuejs.org/v2/guide/components-dynamic-a...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question