• 端口配置:
    vue项目config目录下的index.js中port行改为你想要的端口号,注意该行后面有注释:“can be overwritten by process.env.PORT, if port is in use, a free one will be determined”,vue项目运行时能自行决定能运行的空闲的端口号
  • 应用上下文配置:
    在项目下建一个vue.config.js文件,设置文件中publicPath行值为(比如,“/mac/”),就设置了应用上下文,在npm run dev之后可以访问http://localhost:port/mac/路径。
    如果你不想要路径中有井号(“#”),在src/router/index.js中设置router的mode为"history",代码实例如下
const router = new VueRouter({
    mode: 'history',
    routes: routes
})

springboot项目的配置可以在application.yml中做出来

server:
  port: 8081
  servlet:
    context-path: /map/

参考链接

1

配置参考-vue.config.js-publicPath

2

vue地址去掉 #

相关文章:

  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2021-07-29
  • 2021-04-30
  • 2021-11-23
猜你喜欢
  • 2021-11-23
  • 2022-01-07
  • 2022-12-23
  • 2021-07-25
  • 2021-09-22
  • 2021-10-29
  • 2021-10-29
相关资源
相似解决方案