记一次,vue组件挂载失败(history模式),导致页面空白

420 阅读1分钟

问题描述

image.png

后来发现是 1 和 2 ,这两处,没有保持一致导致的。及路由的base 和 vueconfig.js 的publicPath 要一样,在history 模式下,页面就会挂载成功。

  • 将路由模式 由 history --> hash, 页面挂载上了,显示成功了。 image.png

  • 解决

image.png