文件资源路径是对的,但是页面空白。百度了很久找了一篇文章解决了。

1.vue项目中config文件下index.js中打包配置

build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),

// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/dist/',//history

2.路由配置:router文件夹下index.js
let router = new Router({
mode: 'history',//history
base: '/dist/',//history,
 router:[{...}]
})

原文: https://blog.csdn.net/mjlfto/article/details/80270620

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-06-29
  • 2021-10-15
  • 2021-05-28
  • 2021-05-14
猜你喜欢
  • 2021-09-23
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
相关资源
相似解决方案