访问路径:http://www.test.com/yc
1.vue.config.js文件路径设置publicPath: process.env.NODE_ENV === "production" ? "/yc" : "/"
2.index.html文件添加meta <meta base="/yc/">
3.路由里添加base属性 base:'/yc/'
如:
export default new Router({ mode: 'history', // 去掉url中的# base:'/yuanchuan/', scrollBehavior: () => ({ y: 0 }), routes: constantRoutes })