huibing.xie | 1f1606f | 2018-08-20 15:46:55 +0800 | [diff] [blame^] | 1 | <template> |
| 2 | <section class="app-main"> |
| 3 | <transition name="fade" mode="out-in"> |
| 4 | <!-- <router-view :key="key"></router-view> --> |
| 5 | <keep-alive :include="cachedViews"> |
| 6 | <router-view :key="key"></router-view> |
| 7 | </keep-alive> |
| 8 | </transition> |
| 9 | </section> |
| 10 | </template> |
| 11 | |
| 12 | <script> |
| 13 | export default { |
| 14 | name: 'AppMain', |
| 15 | computed: { |
| 16 | cachedViews() { |
| 17 | return this.$store.state.tagsView.cachedViews |
| 18 | }, |
| 19 | key() { |
| 20 | return this.$route.fullPath |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 | </script> |
| 25 | |
| 26 | <style scoped> |
| 27 | .app-main { |
| 28 | /*50 = navbar */ |
| 29 | min-height: calc(100vh - 84px); |
| 30 | position: relative; |
| 31 | overflow: hidden; |
| 32 | } |
| 33 | </style> |