文档细节优化,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:
张敏
2017-04-23 22:38:50 +08:00
committed by GitHub
parent 1725eb6303
commit ce27957133
23 changed files with 95 additions and 60 deletions
+4 -10
View File
@@ -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