From 58c366928754b6c92aca7e7e515193300d17e192 Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Mon, 28 Feb 2022 11:29:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96PrerenderSPAPlugin=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 6 +++++- src/router/index.ts | 23 ++++++++++++----------- src/views/mobile/Roadmap.vue | 2 +- vue.config.js | 22 +++++++++++----------- 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/main.ts b/src/main.ts index 1e832ad..543ff3a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -16,5 +16,9 @@ Vue.config.productionTip = false new Vue({ router, store, - render: (h) => h(App) + render: (h) => h(App), + mounted() { + // You'll need this for renderAfterDocumentEvent. + document.dispatchEvent(new Event('render-event')) + } }).$mount('#app') diff --git a/src/router/index.ts b/src/router/index.ts index 9faf70e..a005c30 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -30,12 +30,8 @@ const routes: Array = [ { path: '/', name: 'Main', - component: mobile ? MobileIndex : Index - }, - { - path: '/index.html', - name: 'Main1', - component: mobile ? MobileIndex : Index + component: mobile ? MobileIndex : Index, + alias: '/index.html' }, { path: '/market', @@ -68,27 +64,32 @@ const routes: Array = [ { path: '/nft', name: 'Nft', - component: mobile ? MobileNft : NFT + component: mobile ? MobileNft : NFT, + alias: '/nft/index.html' }, { path: '/gameplay', name: 'Gameplay', - component: mobile ? MobileGameplay : Gameplay + component: mobile ? MobileGameplay : Gameplay, + alias: '/gameplay/index.html' }, { path: '/tokenomic', name: 'Tokenomic', - component: mobile ? MobileTokennomic : Tokenomic + component: mobile ? MobileTokennomic : Tokenomic, + alias: '/tokenomic/index.html' }, { path: '/team', name: 'Team', - component: mobile ? MobileTeam : Team + component: mobile ? MobileTeam : Team, + alias: '/team/index.html' }, { path: '/roadmap', name: 'Roadmap', - component: mobile ? MobileRoadmap : Roadmap + component: mobile ? MobileRoadmap : Roadmap, + alias: '/roadmap/index.html' } ] diff --git a/src/views/mobile/Roadmap.vue b/src/views/mobile/Roadmap.vue index 2e198bd..bd9a1d8 100644 --- a/src/views/mobile/Roadmap.vue +++ b/src/views/mobile/Roadmap.vue @@ -1,5 +1,5 @@