From 0083a23d6ff23aa01967a5d21d00f519c9bd4817 Mon Sep 17 00:00:00 2001 From: cookfront Date: Mon, 27 Mar 2017 19:17:10 +0800 Subject: [PATCH] fix examples --- docs/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/index.js b/docs/index.js index 1a954a26b..7dba72a00 100644 --- a/docs/index.js +++ b/docs/index.js @@ -25,7 +25,7 @@ Vue.component('footer-nav', FooterNav); let routesConfig = routes(navConfig); routesConfig.push({ path: '/', - redirect: '/component/button' + redirect: '/component/install' }); const router = new VueRouter({ @@ -38,8 +38,10 @@ router.beforeEach((route, redirect, next) => { if (route.path !== '/') { window.scrollTo(0, 0); } + + const pathname = process.env.NODE_ENV === 'production' ? '/vue' : '/'; if (isMobile()) { - window.location.replace('/vue/' + 'examples.html#' + route.path); + window.location.replace(pathname + 'examples.html#/'); return; } document.title = route.meta.title || document.title;