问题
I building a component 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 component 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 component.
Thanks
回答1:
I found a solution!
return createElement('i', {
domProps: {
innerHTML: this.data
}
}
)
来源:https://stackoverflow.com/questions/51502183/vuejs-createelement-insert-dynamic-html