@
@
@estluced2021-10-15 14:12:17
SVG
@estluced, 2021-10-15 14:12:17

What is the best way to load svg in Vue?

Hello, I'm interested in methods for loading svg in spa, methods with img, etc. not what I need, I need to load icons and specify them, for example, fill, stroke, and so on. so that the whole thing is reactive (I use the vue framework).
What svg loading methods can be used in my case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-10-15
@Aleksandr-JS-Developer

If SVGs are hard-coded, it's the same with other DOM elements.
If not, and svg is loaded into img by src, then only using img ...
If SVG needs its own functionality, then cut separate components with only SVG in the form of tags, and not drive as you like. <img ...>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question