[Vuejs]-Using the correct image path in HTML

0👍

You are not showing us the directory of the file which contains the HTML. I am assuming it is under src/views.

Using .. in a path tells the compiler to look one level up the directory tree.

If your file is in src/views that means src/views/.. evaluates to src/. Then, you tell it to look under the src/assets folder and the path becomes src/src/assets.

Did you see the double src?

Your relative path should be changed to ../assets/img/notification-icon.png.

Using relative paths can be tedious though. I would recommend absolute paths(assuming you use vue-cli)

Leave a comment