F
F
fman22020-12-28 19:08:34
Vue.js
fman2, 2020-12-28 19:08:34

How to render a vue component?

Friends, hello everyone.
The question is. There is an old project with lazy-load, when scrolling, posts are loaded that have vue components, how to make it so that when: rendered components are already added to #div. I've seen examples where the component is created dynamically, it doesn't work, because $html has something like this:
$('#div').append($html);

$html = `
<div class="post">
<div class="content">...</div>
<v-comment-form></v-comment-form>
</div>
`;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-12-28
@fman2

And yet the correct answer is to transfer data, draw based on it. Markup passing is very bad.
But if you really want to: Vue.compile() .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question