Insert component after rendering Vue.js

1

Hi, I'm learning how to use Vue.js and so far I'm learning how to create components.

But I'm having a problem, I'm trying to render a component after loading the page. I have a jQuery code that I want to use, but I do not know how to do it.

$('#test123').html('<inventory message="Click on the Item to activate it."></inventory>');

But this component is not rendered and nothing happens to it, I saw some things on the internet, but the solutions I found rendered one component only, but I need to render several, because the json I'm going to receive, the javascript will do foreach and put in the div.

Thanks for your attention.

    
asked by anonymous 07.10.2018 / 15:14

1 answer

1

The VueJS has its own life cycle. link in the documentation itself explains the methods that control this lifecycle. Instead of using Jquery, VueJS also has the reactivity to HTML code, so you can use "v-html" instead of "v-model" or "v-bind".

    
07.10.2018 / 21:01