shrpne / vue-inline-svg

Dynamically loads an SVG source and inline <svg> element so you can manipulate the style of it
MIT License
177 stars 22 forks source link

How to pass raw string "<svg width="800" height="450" xmlns..." to component #49

Closed clabnet closed 1 year ago

clabnet commented 1 year ago

Hello, I have a string returned from server API as is :

<svg width="800" height="450" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" viewBox="0 0 800 450">
<rect width="800" height="450" x="0" y="0" id="0" fill="rgb(255,255,255)" fill-opacity="0"></rect>
<path d="M80 380.5L720 380.5" fill="none" stroke="#eeeeee"></path>
....

How to pass it to this component ? Thank you

shrpne commented 1 year ago

Hello! You don't need vue-inline-svg here. Just pass your markup to vue template

https://vuejs.org/guide/essentials/template-syntax.html#raw-html

clabnet commented 1 year ago

Yes, stupid me. Thanks.

⁣Ottieni BlueMail per Android ​

Il giorno 29 dic 2022, 14:35, alle ore 14:35, shrpne @.***> ha scritto:

Hello! You don't need vue-inline-svg here. Just pass your markup to vue template

https://vuejs.org/guide/essentials/template-syntax.html#raw-html

-- Reply to this email directly or view it on GitHub: https://github.com/shrpne/vue-inline-svg/issues/49#issuecomment-1367325997 You are receiving this because you authored the thread.

Message ID: @.***>