N
N
nen0y2020-07-22 10:56:47
Sass
nen0y, 2020-07-22 10:56:47

How to write the correct path for an image?

You need to set background-image, I wrote the path to this image: I get the following error: Tell me how to fix this problem? background-image: url("./../../assets/logo.png");
5f17f0da6acaa736449570.png

5f17f12496b09711498201.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Kirshin, 2020-07-22
@nen0y

If vue-cli then it has a wonderful alias @ then the path would be like or for css/scss/sass
<img src="@/assets/logo.png" />

.example {
  background-image: url("[email protected]/assets/logo.png");
}

If you are building without vue-cli on your own with webpack, then you can set the alias yourself in webpack.config

V
Vladimir Korotenko, 2020-07-22
@firedragon

./logo.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question