refactor:add keep-alive && component add name

This commit is contained in:
Pan
2017-10-31 10:49:24 +08:00
parent a932272b8f
commit 1ae31fdd45
28 changed files with 147 additions and 63 deletions

View File

@@ -168,7 +168,7 @@ const calendarTypeKeyValue = calendarTypeOptions.reduce((acc, cur) => {
}, {})
export default {
name: 'table_demo',
name: 'complexTable',
directives: {
waves
},

View File

@@ -64,7 +64,7 @@ import { fetchList } from '@/api/article'
import Sortable from 'sortablejs'
export default {
name: 'drag-table_demo',
name: 'dragTable',
data() {
return {
list: null,

View File

@@ -13,6 +13,7 @@ import fixedThead from './fixedThead'
import unfixedThead from './unfixedThead'
export default {
name: 'dynamicTable',
components: { fixedThead, unfixedThead }
}
</script>

View File

@@ -1,5 +1,18 @@
<template>
<keep-alive>
<router-view></router-view>
</keep-alive>
<transition name="fade" mode="out-in">
<keep-alive :include='cachedViews'>
<router-view></router-view>
</keep-alive>
</transition>
</template>
<script>
export default {
name: 'TableMain',
computed: {
cachedViews() {
return this.$store.state.app.cachedViews
}
}
}
</script>

View File

@@ -54,7 +54,7 @@
import { fetchList } from '@/api/article'
export default {
name: 'inline_edit-table_demo',
name: 'inlineEditTable',
data() {
return {
list: null,