I
I
Ivan Sergeev2017-01-08 16:27:17
JavaScript
Ivan Sergeev, 2017-01-08 16:27:17

vue.js. How to substitute a component with data on a link click?

Good evening!
There is a structure of the main html template, as an example:

<template>
   <img src="img.jpg" />
   <a>Узнать детали</a>
</template>

and there is a template number 2, which contains the html code, which should be substituted into the main template by clicking on the "Learn details" link. The code:
<template>
   <p>Детальное описание изображения: {{ item.description }}</p>
</template>

How to correctly implement this on VUE.JS?
is it possible to do it with a tag <component></component>or some other way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lega, 2017-01-08
@ivan3008

Throw the second pattern into the first one and output it by v-if condition

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question