Answer the question
In order to leave comments, you need to log in
How to insert raw html + vue component + raw html ... into a page?
The problem is this:
There is a line containing page markup, you need to pre
replace all tags with vue components.
I parsed the string with a regular expression and inserted it into the template in a loop using v-html:
<div v-for="item in arr">
<кусок до/после pre>
<!-- Например, в первой итерации <table><tr><td>,
а во второй </td><td>, и так далее -->
<компонент вместо pre>
</div>
<кусок до pre>
, then <компонент вместо pre>
, automatically closing unclosed tags (which should be closed in the next iteration of the loop), which should contain a new component. in particular, there are replacements inside table cells - the output is a table with one cell, and after it, one by one, the inserted components follow. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question