一、问题
使用VUE路由,项目的url总是带有锚点,如下:
http://localhost:8082/#/
二、解决
修改路由文件中 index.js 文件,即 src --> router --> index.js
没修改前:
export default new Router({
routes: [
{
path: '/',
name: 'IndexPage',
component: IndexPage
}
]
})
去 #/锚点:
export default new Router({
mode: 'history',
routes: [
{
path: '/',
name: 'IndexPage',
component: IndexPage
}
]
})