mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-09-08 17:06:21 +08:00
[Doc] fit mobile
This commit is contained in:
parent
557fcc2f8c
commit
436b446e49
@ -11,7 +11,14 @@ const router = new VueRouter({
|
|||||||
routes: routes()
|
routes: routes()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const ua = navigator.userAgent.toLowerCase();
|
||||||
|
const isMobile = /ios|iphone|ipod|ipad|android/.test(ua);
|
||||||
|
|
||||||
router.beforeEach((route, redirect, next) => {
|
router.beforeEach((route, redirect, next) => {
|
||||||
|
if (isMobile) {
|
||||||
|
location.replace('https://youzan.github.io/vant/mobile.html?weapp=1');
|
||||||
|
}
|
||||||
|
|
||||||
progress.start();
|
progress.start();
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user