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.
59 lines
1.2 KiB
59 lines
1.2 KiB
<template>
|
|
<div id="app">
|
|
<transition :name="$route.meta.transition">
|
|
<keep-alive :include="cachedViews">
|
|
<router-view class="router-view"/>
|
|
</keep-alive>
|
|
</transition>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
query: {},
|
|
version: '1.3.3',
|
|
cachedViews: []
|
|
}
|
|
},
|
|
created () {
|
|
this.versionReload()
|
|
},
|
|
methods: {
|
|
versionReload(){
|
|
let version = this.version //版本号(每次上线前需要更新下版本号)
|
|
console.log('最新系统版本: ',version)
|
|
console.log('当前系统版本: ',this.version)
|
|
let versionLocal = localStorage.getItem('_version_');
|
|
if(version!=versionLocal){
|
|
localStorage.setItem('_version_',version);
|
|
this.version=versionLocal;
|
|
location.reload();
|
|
}
|
|
}
|
|
},
|
|
watch: {
|
|
$route(to) {
|
|
if (to.meta.keepAlive) {
|
|
this.cachedViews.push(to.name)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
</script>
|
|
<style>
|
|
.instant-enter-active,
|
|
.instant-leave-active {
|
|
transition: none !important;
|
|
}
|
|
.router-view {
|
|
position: absolute;
|
|
width: 100%;
|
|
backface-visibility: hidden;
|
|
contain: content;
|
|
}
|
|
</style>
|