提交 59073fb0 编写于 作者: P Pan

refactor: add keep-alive

上级 c82ed3fc
<template>
<keep-alive>
<router-view></router-view>
</keep-alive>
</template>
<template>
<section class="app-main" style="min-height: 100%">
<transition name="fade" mode="out-in">
<router-view :key="key"></router-view>
<keep-alive>
<router-view></router-view>
</keep-alive>
</transition>
</section>
</template>
<script>
export default {
name: 'AppMain',
computed: {
key() {
return this.$route.name !== undefined ? this.$route.name + +new Date() : this.$route + +new Date()
}
}
name: 'AppMain'
}
</script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册