After resolving Vue project packaged open the index.html page displays a blank picture path and the wrong question

Configuration build command in config / index.js in a property called assetsPublicPath, its value is '/'. It means that the root directory, then will start looking from the root directory of the hard drive where the index.html, they can not be found.

The solution: to './' then you are no longer the absolute path of the root directory, but instead a relative path, to find the same directory.

build: {
    ...
    assetsPublicPath: './',

 

Guess you like

Origin www.cnblogs.com/223zzm/p/11259104.html