如何解決npm run build後頁面空白?

*歡迎關注前端小謳的github,閱讀更多原創技術文章!前端

問題一:assetsPublicPath配置錯誤

解決辦法:打開config/index.js文件git

build:{
    // assetsPublicPath: '/'
    assetsPublicPath: './'
}
複製代碼

問題二:路由history模式配置有誤

解決辦法:關閉路由historym模式github

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

相關文章
相關標籤/搜索