mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
zanui router redirect
This commit is contained in:
parent
39b5472f6a
commit
837d5249c0
@ -14,10 +14,16 @@ Vue.use(VueRouter);
|
|||||||
Vue.component('side-nav', SideNav);
|
Vue.component('side-nav', SideNav);
|
||||||
Vue.component('mobile', Mobile);
|
Vue.component('mobile', Mobile);
|
||||||
|
|
||||||
|
let routesConfig = routes(navConfig);
|
||||||
|
routesConfig.push({
|
||||||
|
path: '/',
|
||||||
|
redirect: '/component/button'
|
||||||
|
});
|
||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
mode: 'hash',
|
mode: 'hash',
|
||||||
base: __dirname,
|
base: __dirname,
|
||||||
routes: routes(navConfig)
|
routes: routesConfig
|
||||||
});
|
});
|
||||||
|
|
||||||
let indexScrollTop = 0;
|
let indexScrollTop = 0;
|
||||||
@ -36,6 +42,7 @@ router.afterEach(route => {
|
|||||||
Vue.nextTick(() => {
|
Vue.nextTick(() => {
|
||||||
document.body.scrollTop = indexScrollTop;
|
document.body.scrollTop = indexScrollTop;
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
icon: String,
|
icon: String,
|
||||||
title: String,
|
title: String,
|
||||||
value: String,
|
value: [String, Number],
|
||||||
url: String,
|
url: String,
|
||||||
label: String,
|
label: String,
|
||||||
isLink: Boolean
|
isLink: Boolean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user