其他分享
首页 > 其他分享> > vue3 去除#的方法

vue3 去除#的方法

作者:互联网

 createWebHistory路由模式路径不带#号(生产环境下不能直接访问项目,需要nginx转发)

http://localhost:8080/#/
const router = createRouter({
  history: createWebHistory(),
  routes
});

createWebHashHistory路由模式路径带#号

http://localhost:8080/
const router = createRouter({
  history: createWebHashHistory(),
  routes
});

标签:const,去除,vue3,8080,createWebHistory,createRouter,http,方法,localhost
来源: https://www.cnblogs.com/zyh2333/p/15247182.html