如何将vue项目中地址上的#去掉

2020-05-10  本文已影响0人  柒秒时光

vue-router 设置 history 模式

vue-router 默认为 hash 模式,使用默认的 hash 模式,浏览器 URL 地址中会有一个 #,如果有需求要讲#去掉就将vue-router 设置 history 模式

const router = new Router({
  mode: 'history',
  routes: [......]
})
上一篇 下一篇

猜你喜欢

热点阅读