Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VueJs CreateElement() insert dynamic html

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

like image 232
Cesar Cabral Avatar asked May 21 '26 08:05

Cesar Cabral


1 Answers

I found a solution!

return createElement('i', {
          domProps: {
            innerHTML: this.data
          }
        }
      )
like image 127
Cesar Cabral Avatar answered May 22 '26 20:05

Cesar Cabral