Skip to content

Commit

Permalink
fix(dashboard): page change should not refresh board (#3930)
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Jun 23, 2020
1 parent a7b4552 commit 321d249
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/panel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const main = async () => {
mode: 'hash',
base: __dirname,
routes: [
{ path: '/', name: 'Dashboard', component: () => import('./views/dashboard/dashboard.vue') },
{ path: '/', name: 'Dashboard', component: () => import('./views/dashboard/empty.vue') },
{ path: '/stats/api', name: 'APIStats', component: () => import('./views/stats/api.vue') },
{ path: '/stats/commandcount', name: 'CommandCountStats', component: () => import('./views/stats/commandcount.vue') },
{ path: '/stats/tips', name: 'TipsStats', component: () => import('./views/stats/tips.vue') },
Expand Down Expand Up @@ -174,6 +174,7 @@ const main = async () => {
new Vue({
router,
components: {
dashboard: () => import('./views/dashboard/dashboard.vue'),
navbar: () => import('./components/navbar/navbar.vue'),
statsbar: () => import('./components/statsbar/statsbar.vue'),
changegamedialog: () => import('./components/dialog/changegamedialog.vue'),
Expand Down Expand Up @@ -245,7 +246,20 @@ const main = async () => {
<navbar/>
<statsbar/>
<changegamedialog/>
<router-view class="view pt-1"></router-view>
<dashboard
class="view pt-1"
:style="{
visibility: $route.path === '/' ? 'visible' : 'hidden',
position: $route.path === '/' ? 'inherit' : 'absolute'
}"
/>
<router-view
class="view pt-1"
:style="{
visibility: $route.path !== '/' ? 'visible' : 'hidden',
position: $route.path !== '/' ? 'inherit' : 'absolute'
}"
/>
<footerbar/>
</div>
`,
Expand Down
4 changes: 4 additions & 0 deletions src/panel/views/dashboard/empty.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template>
<div>
</div>
</template>

0 comments on commit 321d249

Please sign in to comment.