You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
833 B
41 lines
833 B
<template>
|
|
<div id="app">
|
|
<RouterView v-if="isRouterAlive" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
provide() {
|
|
return {
|
|
reload: this.reload
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
isRouterAlive: true
|
|
}
|
|
},
|
|
watch: {
|
|
$route: 'routeChange'
|
|
},
|
|
methods: {
|
|
reload() {
|
|
this.isRouterAlive = false
|
|
this.$nextTick(() => (this.isRouterAlive = true))
|
|
},
|
|
routeChange(newVal, oldVal) {
|
|
if (newVal.name == oldVal.name) {
|
|
this.reload()
|
|
}
|
|
}
|
|
},
|
|
metaInfo: {
|
|
titleTemplate: title => {
|
|
return title
|
|
? `${title} - ${process.env.VUE_APP_TITLE}`
|
|
: process.env.VUE_APP_TITLE
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|