E
E
Egor Babintsev2021-04-05 09:58:44
SVG
Egor Babintsev, 2021-04-05 09:58:44

How to solve incorrect path resolution for VueJS sprites?

Good day gentlemen!
There is a problem with sprite url resolution (app generated by vue-cli 4 on vue3). We have a component, in the template of which a link to the sprite "[email protected]/assets/svg/sprite.svg#icon_name" is inserted using use xlink:href. When I include the sprite for the first time, the url resolves normally "/img/solid.2ead6474.svg#times" for example, but when I access the sprite for the second time, #icon_name is not added at the end, the url just leads to the sprite. If I try to set the correct url in devtools, then I get an error: Namespace prefix xlink for href on span is not defined. Tried declaring xmlns:xlink for all sprite, for specific use - doesn't help. Shaw to do?
I will be very grateful for your help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question