From 4e1cca0e3da79819fa3768402ce6a174aea5131f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 11 八月 2019 23:35:45 +0800 Subject: [PATCH] 2019-08-11 --- src/router/index.js | 178 +++++++++++++++++++++++++++++++---------------------------- 1 files changed, 93 insertions(+), 85 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 0f4e81b..6a2653e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -32,89 +32,97 @@ const CaseSolution = resolve => require(['@/views/successCase/caseSolution'], resolve) const center = resolve => require(['@/views/successCase/center'], resolve) -const constantRouterMap = [{ - path: '/', - // name: 'Home', - component: Home, - children: [ - { - path: '/', - name: 'Index', - component: Index - }, - { - name: 'ProductCenter', - path: '/productCenter',//浜у搧杞欢 - component: ProductCenter - }, - { - name: 'SuccessCase', - path: '/successCase',//鎴愬姛妗堜緥 - component: SuccessCase, - },{ - name: 'SuccessCaseIndex', - path: '/SuccessCaseIndex',//鎴愬姛妗堜緥 璇︽儏 - component: SuccessCaseIndex, - }, - { - name: 'CaseDetail', - path: '/caseDetail',//瑙e喅鏂规 璇︽儏 - component: CaseDetail - }, - { - name: 'Partner', - path: '/partner',//鍚堜綔浼欎即 - component: Partner - }, - { - name: 'News', - path: '/news',//鏄庣鍔ㄦ�� 鐗堟湰2 - component: News - }, - { - name: 'AboutMingKe', - path: '/AboutMingKe',//鍏充簬鏄庣 - component: AboutMingKe - }, - { - name: 'postDetails', - path: '/postDetails',//鑱屼綅璇︽儏 - component: postDetails - }, - { - name: 'CompanyProfile', - path: '/companyProfile',//浼佷笟鏂囧寲 - component: CompanyProfile - }, - { - name: 'JoinMingKe', - path: '/joinMingKe',//鍔犲叆鏄庣 - component: JoinMingKe - }, - { - name: 'ContactInformation', - path: '/contactInformation',//鐢宠鍔犲叆 - component: ContactInformation - }, - { - name: 'DynamicDetail', - path: '/dynamicDetail',//鏄庣鍔ㄦ�� 璇︽儏 - component: DynamicDetail - }, - { - name: 'CaseSolution', - path: '/caseSolution',//瑙e喅鏂规 - component: CaseSolution - }, - { - name: 'center', - path: '/center',//瑙e喅鏂规 - component: center - } - ] -}] +const router = new Router({ + routes: [{ + path: '/', + // name: 'Home', + component: Home, + children: [ + { + path: '/', + name: 'Index', + component: Index + }, + { + name: 'ProductCenter', + path: '/productCenter',//浜у搧杞欢 + component: ProductCenter + }, + { + name: 'SuccessCase', + path: '/successCase',//鎴愬姛妗堜緥 + component: SuccessCase, + },{ + name: 'SuccessCaseIndex', + path: '/SuccessCaseIndex',//鎴愬姛妗堜緥 璇︽儏 + component: SuccessCaseIndex, + }, + { + name: 'CaseDetail', + path: '/caseDetail',//瑙e喅鏂规 璇︽儏 + component: CaseDetail + }, + { + name: 'Partner', + path: '/partner',//鍚堜綔浼欎即 + component: Partner + }, + { + name: 'News', + path: '/news',//鏄庣鍔ㄦ�� 鐗堟湰2 + component: News + }, + { + name: 'AboutMingKe', + path: '/AboutMingKe',//鍏充簬鏄庣 + component: AboutMingKe + }, + { + name: 'postDetails', + path: '/postDetails',//鑱屼綅璇︽儏 + component: postDetails + }, + { + name: 'CompanyProfile', + path: '/companyProfile',//浼佷笟鏂囧寲 + component: CompanyProfile + }, + { + name: 'JoinMingKe', + path: '/joinMingKe',//鍔犲叆鏄庣 + component: JoinMingKe + }, + { + name: 'ContactInformation', + path: '/contactInformation',//鐢宠鍔犲叆 + component: ContactInformation + }, + { + name: 'DynamicDetail', + path: '/dynamicDetail',//鏄庣鍔ㄦ�� 璇︽儏 + component: DynamicDetail + }, + { + name: 'CaseSolution', + path: '/caseSolution',//瑙e喅鏂规 + component: CaseSolution + }, + { + name: 'center', + path: '/center',//瑙e喅鏂规 + component: center + } + ] + }] +}) -export default new Router({ - routes: constantRouterMap, - scrollBehavior(to, from, savedPosition) {} -}) \ No newline at end of file +router.afterEach(() => { + window.scrollTo(0, 0) +}) + +// new Router({ +// routes: constantRouterMap, +// scrollBehavior(to, from, savedPosition) {} +// }) + +export default router -- Gitblit v1.8.0