Solution to blank page after Vue project is deployed online, page blank after Vue project is packaged and released online, console error solution

The page is blank after the Vue project is deployed online

Change the routing mode to hash mode here

const router = new VueRouter({
    
    
  base: '/',
  mode: 'hash',
  routes,
})

export default router

In the Vue2.6 version, the vue.config.js file needs to be created by ourselves. After
creating the file, write the following code

module.exports = {
    
    
    publicPath: '/',  // 注意 这里使用 /  如果不行的话  就 ./ 
    outputDir:'dist',  // 包名
    assetsDir:'static/official_website_new'   // 部署资源包的目录
}

Guess you like

Origin blog.csdn.net/weixin_52400118/article/details/110057767