(1) La diferencia entre el modo hash y el historial en vue
- Enlace de referencia: https://blog.csdn.net/lyn1772671980/article/details/80804419
(2) Guía de implementación
- Consulte el sitio web oficial: https://cli.vuejs.org/zh/guide/deployment.html
Notas de uso:
-
Vista previa local
npm install -g serve
# -s 参数的意思是将其架设在 Single-Page Application 模式下
# 这个模式会处理即将提到的路由问题
serve -s dist
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
}
}
} // 配置多个代理
},
*******
}
- Dirección de referencia: https://cli.vuejs.org/zh/config/#pages