文档细节优化,search、咯阿丁和dialog组件样式修复 (#5)
* fix: loading small style, search style and dialog style * fix: scroll to top * fix mobile scroll * fix scroll to top
This commit is contained in:
+4
-10
@@ -15,24 +15,18 @@ Vue.use(ZanUI.Lazyload, {
|
||||
});
|
||||
Vue.use(VueRouter);
|
||||
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
const routesConfig = routes(navConfig, true);
|
||||
routesConfig.push({
|
||||
path: '/',
|
||||
component: DemoList.default || DemoList
|
||||
});
|
||||
const router = new VueRouter({
|
||||
mode: 'hash',
|
||||
base: isProduction ? '/zanui/vue/' : __dirname,
|
||||
mode: 'history',
|
||||
base: '/zanui/vue/examples',
|
||||
routes: routesConfig
|
||||
});
|
||||
|
||||
router.beforeEach((route, redirect, next) => {
|
||||
if (route.path !== '/') {
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
document.title = route.meta.title || document.title;
|
||||
next();
|
||||
router.afterEach((route, redirect, next) => {
|
||||
document.querySelector('.examples-container').scrollTop = 0;
|
||||
});
|
||||
|
||||
new Vue({ // eslint-disable-line
|
||||
|
||||
Reference in New Issue
Block a user