L
L
Luke LikeSkywalker2018-09-27 10:21:36
Vue.js
Luke LikeSkywalker, 2018-09-27 10:21:36

Is it possible to dynamically insert svg into html?

It is necessary to embed in the html svg file when the switch condition is met. The option with the img tag with dynamic paths is gone, as is the creation of components from svg. The last option is due to the fact that I will need to import about 20 svg components and only 1 of them will be embedded in the DOM

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Proskurin, 2018-09-27
@oolooq

You can svg sprites in a separate block, and in vue you can connect the desired image from the sprite through use.
The rest of the icons are also placed in and called in vue through

<svg version="1.1">
    <use href="#unqie_id" width="90" height="90"></use>
  </svg>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question