S
S
Sector5672020-04-26 15:34:19
Vue.js
Sector567, 2020-04-26 15:34:19

How to remove slash when building path in assembly in vue.js?

I use vue-cli, vue init webpack-simple

After I build the project (npm run build), the image paths look like this:

<img src="/dist/logo.png?722ab7e259fc81a6ecdac5abdcd19285" alt="logo" />


The problem is that pictures cannot be loaded if the path starts with a slash, that is,
you need to somehow remove the slash before dist at the build stage, then all pictures will be successfully loaded.
How can I do that?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question