VUE package access to static resource path problems

Vue introduces the static resource directory in the Static folder, such as pictures, fonts, etc.

We found that this image path is no problem after running npm run start, but how will it be packaged?

We know that the Dist folder will be generated after executing NPM Run Build, and INDEX.HTML inside will be found in the browser.

picture path error! ! !

Vue打包后访问静态资源路径问题 Workaround:

1. First find the index.js file under Config

Change the last ‘/’ to ‘./’Vue打包后访问静态资源路径问题

2. Next, change the image address to

Vue打包后访问静态资源路径问题

The above is the relevant knowledge point of the VUE to access the static resource path problem, thank you for reading and support for Tumi Cloud. Vue打包后访问静态资源路径问题

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment