Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs: reload page data on HMR
  • Loading branch information
KaelWD committed Sep 15, 2020
1 parent a0866c8 commit f8a7e83
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions packages/docs/src/views/Documentation.vue
Expand Up @@ -7,13 +7,7 @@
class="mx-auto overflow-visible"
max-width="868"
>
<skeleton-loader
v-if="!component"
key="loader"
/>

<keep-alive
v-else
max="3"
>
<component :is="component" />
Expand All @@ -24,6 +18,7 @@

<script>
// Utilities
import { IN_BROWSER } from '@/util/globals'
import { genMetaData } from '@/util/metadata'
import { get, sync } from 'vuex-pathify'
import { localeLookup } from '@/i18n/util'
Expand Down Expand Up @@ -94,20 +89,16 @@
]),
},
created () {
async created () {
if (IN_BROWSER && !this.$vuetify.isHydrating) {
await this.$options.asyncData({
route: this.$route,
store: this.$store,
})
}
this.init(this.md)
},
async beforeRouteUpdate (to, from, next) {
if (to.path === from.path) return next()
await this.$options.asyncData({
route: to,
store: this.$store,
})
next()
},
methods: {
init (md) {
const {
Expand Down

0 comments on commit f8a7e83

Please sign in to comment.