mode history 这个我知道,我问的是hash模式怎么去井号前面的字符.怎样在修改地址栏回车后,清理没用的字符,比如说#号前面的这些,怎么排除非/的路径呀{ path: '*', component: () => import('../pages/not_found') }, { path: '/', redirect: '/index', component: layout, children: [{ path: '/index', component: () => import('../pages/index') }] },
9 回答

至尊宝的传说
TA贡献1789条经验 获得超10个赞
在主页面价格判断,如果当前地址不是你要的,直接重定向一下就可以了.
if(location.pathname != '/') {
location.href = '/' + location.hash
}
添加回答
举报
0/150
提交
取消