-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[vue] 怎么解决vue打包后静态资源图片失效的问题? #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
没遇到这个问题 - - |
设置assetsPublicPath将 assetsPublicPath: '/' 改为 assetsPublicPath: './' |
background: url("@/assets/images/xxxxx") |
加这个可以吗?publicPath: '../../' |
找到config/index.js 配置文件,找build打包对象里的assetsPublicPath属性 默认值为/,更改为./就好了 |
最新的 用vue-cli构建的VUE项目,貌似没有那个config文件夹,更没有那个assetsPublicPath属性了,怎么办呢 |
最新的vue-cli 需要在根目录下建一个vue.config.js 在里面配置publicPath即可 |
1.静态图片,webpack打包的时候复制到指定目录,设置assetsPublicPath |
可以自己新建的config.js 在里面配置 |
assetsPublicPath想自己定义的可以在根目录下的vue.config.js里去配置,vue-cli文档有些 |
上面蛮多回答感觉像开玩笑似的,静态资源图片失效分几种情况。 |
最新的vue-cli 需要在根目录下建一个vue.config.js 在里面配置publicPath即可,至于怎么写,去看vue-cll官网的api即可找到详细信息。 |
[vue] 怎么解决vue打包后静态资源图片失效的问题?
The text was updated successfully, but these errors were encountered: