P
P
Pavel Mikhalovsky2018-03-01 17:39:09
JavaScript
Pavel Mikhalovsky, 2018-03-01 17:39:09

How to pass value to router-view?

I'm making a virtual lab and using vue. I use vue-router to provide navigation. Everything would be fine, but I need to switch between the experience itself and the theory of experience. To switch, I made buttons in the header, which are not included in vue-router.
I would like that when one button is pressed, there is a signal to switch to theory, and when another button is pressed, there is a signal to switch to practice.
UPD: I solved it using props on child components

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0
0xD34F, 2018-03-01
@0xD34F

So, what's the problem? Do it by clicking on the button this.$router.push(куда там вам надо).
In general, it’s not very clear - why are there some buttons, why router-linkdidn’t you like it?

A
Alexey Evtifiev, 2018-03-01
@evtifiev

Transfer with. props

this.$router.push({
   name: 'CalculateCreate',
   params: { calculationData: calculationData }
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question