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
 |  Show 1 more ment

1 Answer 1

Reset to default 8

I found a solution!

return createElement('i', {
          domProps: {
            innerHTML: this.data
          }
        }
      )

本文标签: javascriptVueJs CreateElement() insert dynamic htmlStack Overflow