V
V
Virtor902020-10-21 12:32:01
Vue.js
Virtor90, 2020-10-21 12:32:01

Vue. Axios. Download (import) a component into another component by pressing a button. How to make the component work?

I have a Vue component that consists of a table whose rows are loaded via axios.
Example:
...

<tr v-for="tr in table_body">
    <td v-for="td in tr" v-html="td"></td>
</tr>

...

It is assumed that the table cells will contain html data (formatted or colorized text).
But what if another component needs to be displayed in the cells (for example, a dynamic button), in my case it is a button with a popup form.

How to determine that, among other things, another component has arrived in the json data, and it needs to be "launched?"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-10-21
@Virtor90

Bad answer : Vue.compile().
Correct answer : working with Vue (and not only) you should not drive html markup, you should drive data. The front must be responsible for all the design. Including which component to display which data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question