W
W
WebDev2018-10-10 17:26:35
Vue.js
WebDev, 2018-10-10 17:26:35

Using @ in vuejs paths?

When I specify the path to a file, such as an image, I can use the dog as a link to the src directory. For example Or But, for some reason it is impossible to use such a dog in styles. Maybe there is some option? I have the following project structure: -src --assets ---images --components ---head_elements ---footer_elements ---... And in the styles inside these components, the view paths are obtained
<img src="@/assets/logo.svg">
import Footer from '@/components/Footer'

.element {
    bakcground: url('../../assets/images/logo.jpg');
}

Very uncomfortable and not flexible. How can this be fixed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2018-10-10
@kirill-93

.element {
    background: url('[email protected]/assets/images/logo.jpg');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question