换种模式
const router = new VueRouter({
mode: 'history',
routes: [...]
})
1.开启html history模式
2.rewrite url
// nginx例如
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html?s=$1 last;
break;
}
}
vue.js的路由地址会以#号分隔,去掉
最新推荐文章于 2024-05-05 08:48:00 发布