D
D
Denioo2020-06-18 12:15:08
JavaScript
Denioo, 2020-06-18 12:15:08

Svg as a component in Vue?

Hello everyone, in React you can pass an svg image as a component, but is it possible to do this in vue? And how else can you set background-image in styles in vue?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arseny, 2020-06-18
@Denioo

In a single file component, use the svg root element. And you will be happy.
And the styles are described in the documentation, they are transferred by an object in the format of writing ordinary styles in JS (backgroundImage? for example).

I
Ilya Tereshchenko, 2020-06-18
@inFernal123

The vue-svg-loader library will help you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question