refactor: add keep-alive
This commit is contained in:
parent
c82ed3fcbf
commit
59073fb013
|
@ -1,3 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
|
<keep-alive>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
|
</keep-alive>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,18 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<section class="app-main" style="min-height: 100%">
|
<section class="app-main" style="min-height: 100%">
|
||||||
<transition name="fade" mode="out-in">
|
<transition name="fade" mode="out-in">
|
||||||
<router-view :key="key"></router-view>
|
<keep-alive>
|
||||||
|
<router-view></router-view>
|
||||||
|
</keep-alive>
|
||||||
</transition>
|
</transition>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'AppMain',
|
name: 'AppMain'
|
||||||
computed: {
|
|
||||||
key() {
|
|
||||||
return this.$route.name !== undefined ? this.$route.name + +new Date() : this.$route + +new Date()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue