admin管理员组文章数量:1357294
I building a ponent to convert all icons to SVG.
So, at the end of my code I have this:
return createElement('i',
'<SVG>CODE</SVG>'
)
Where is this SPAN, I should add a dynamic HTML! I could not find any option to do it. This HTML will be an SVG, so, for this reason, I need to add the full HTML.
Somebody had the same problem? What is missing?? How to make this as new HTML, when my ponent is running???
ps: I dont need to know how to create a SVG file, but yes, how render the HTML, that can be anyone, inside of my dynamic ponent.
Thanks
I building a ponent to convert all icons to SVG.
So, at the end of my code I have this:
return createElement('i',
'<SVG>CODE</SVG>'
)
Where is this SPAN, I should add a dynamic HTML! I could not find any option to do it. This HTML will be an SVG, so, for this reason, I need to add the full HTML.
Somebody had the same problem? What is missing?? How to make this as new HTML, when my ponent is running???
ps: I dont need to know how to create a SVG file, but yes, how render the HTML, that can be anyone, inside of my dynamic ponent.
Thanks
Share Improve this question edited Jul 24, 2018 at 16:01 Quentin 945k132 gold badges1.3k silver badges1.4k bronze badges asked Jul 24, 2018 at 15:15 Cesar CabralCesar Cabral 3414 silver badges13 bronze badges 6- stackoverflow./q/3492322 – IVO GELOV Commented Jul 24, 2018 at 15:19
- I already have my SVG content. I just need to find a way to render my HTML as HTML and as STRING. – Cesar Cabral Commented Jul 24, 2018 at 15:20
-
Perhaps like this
<div v-html="my_svg_string"></div><div>{{ my_svg_string }}</div>
? – IVO GELOV Commented Jul 24, 2018 at 15:22 -
Have you looked at
v-html
? – zero298 Commented Jul 24, 2018 at 15:23 - is a dynamic element. I think that I can't do that. I found what I need. I should add an attribute: domProps: {innerHTML: this.data} – Cesar Cabral Commented Jul 24, 2018 at 15:53
1 Answer
Reset to default 8I found a solution!
return createElement('i', {
domProps: {
innerHTML: this.data
}
}
)
本文标签: javascriptVueJs CreateElement() insert dynamic htmlStack Overflow
版权声明:本文标题:javascript - VueJs CreateElement() insert dynamic html - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744057671a2583549.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论