Browse Source

fix monitor list jumping to top on route change

pull/280/head
henrygd 3 years ago
parent
commit
2776f942ab
  1. 5
      src/components/MonitorList.vue
  2. 3
      src/layouts/Layout.vue
  3. 3
      src/pages/Dashboard.vue

5
src/components/MonitorList.vue

@ -89,8 +89,9 @@ export default {
.list {
&.scrollbar {
height: calc(100vh - 20px);
overflow-y: scroll;
min-height: calc(100vh - 240px);
max-height: calc(100vh - 20px);
overflow-y: auto;
position: sticky;
top: 10px;
}

3
src/layouts/Layout.vue

@ -40,8 +40,7 @@
</header>
<main>
<!-- Add :key to disable vue router re-use the same component -->
<router-view v-if="$root.loggedIn" :key="$route.fullPath" />
<router-view v-if="$root.loggedIn" />
<Login v-if="! $root.loggedIn && $root.allowLoginDialog" />
</main>

3
src/pages/Dashboard.vue

@ -9,7 +9,8 @@
</div>
<div class="col-12 col-md-7 col-xl-8 mb-3">
<router-view />
<!-- Add :key to disable vue router re-use the same component -->
<router-view :key="$route.fullPath" />
</div>
</div>
</div>

Loading…
Cancel
Save