Vue mode and application deployment

(1) The difference between mode hash and history in vue

(2) Deployment guide

Notes on use:

  1. Local preview

npm install -g serve
# -s 参数的意思是将其架设在 Single-Page Application 模式下
# 这个模式会处理即将提到的路由问题
serve -s dist

(3) Cross-domain issues

module.exports = { 
*******
lintOnSave: false,
  baseUrl: process.env.NODE_ENV === 'production' ? '/online/' : '/',
  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:8080', // 配置目标的地址
        ws: true, // proxy websockets
        changeOrigin: true, // needed for virtual hosted sites
        pathRewrite: {
          '^/api': '' // rewrite path
        }
      }
    } // 配置多个代理
  },
*******
}

(4) Build multi-page applications

 

 

 

Published 108 original articles · Like 58 · Visits 50,000+

Guess you like

Origin blog.csdn.net/qq_41893274/article/details/105343102