如何解决npm-run-build后页面空白

欢迎关注前端小讴的github,阅读更多原创技术文章
问题一:assetsPublicPath配置错误

解决办法:打开config/index.js文件

build:{
    // assetsPublicPath: '/'
    assetsPublicPath: './'
}

问题二:路由history模式配置有误

解决办法:关闭路由historym模式

export default new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRouterMap
})

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理