mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix examples
This commit is contained in:
parent
6f51c93d6c
commit
0083a23d6f
@ -25,7 +25,7 @@ Vue.component('footer-nav', FooterNav);
|
|||||||
let routesConfig = routes(navConfig);
|
let routesConfig = routes(navConfig);
|
||||||
routesConfig.push({
|
routesConfig.push({
|
||||||
path: '/',
|
path: '/',
|
||||||
redirect: '/component/button'
|
redirect: '/component/install'
|
||||||
});
|
});
|
||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
@ -38,8 +38,10 @@ router.beforeEach((route, redirect, next) => {
|
|||||||
if (route.path !== '/') {
|
if (route.path !== '/') {
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const pathname = process.env.NODE_ENV === 'production' ? '/vue' : '/';
|
||||||
if (isMobile()) {
|
if (isMobile()) {
|
||||||
window.location.replace('/vue/' + 'examples.html#' + route.path);
|
window.location.replace(pathname + 'examples.html#/');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
document.title = route.meta.title || document.title;
|
document.title = route.meta.title || document.title;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user