Answer the question
In order to leave comments, you need to log in
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');
}
Answer the question
In order to leave comments, you need to log in
.element {
background: url('[email protected]/assets/images/logo.jpg');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question