Skip to content

Commit

Permalink
支持 router-view 的 keep alive 模式
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdahoo committed Aug 24, 2017
1 parent 49f3e7f commit 85c05e3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 88 deletions.
4 changes: 3 additions & 1 deletion demo/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<template>
<div id="app">
<router-view></router-view>
<keep-alive>
<router-view></router-view>
</keep-alive>
</div>
</template>
5 changes: 0 additions & 5 deletions demo/components/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@
陈妍希
<img src="../assets/arrow-right.png" class="arrow-right">
</router-link>

<router-link class="row" tag="label" to="/keepAlive">
Keep Alive
<img src="../assets/arrow-right.png" class="arrow-right">
</router-link>
</scroller>

<!-- github corner -->
Expand Down
78 changes: 0 additions & 78 deletions demo/components/KeepAlive.vue

This file was deleted.

2 changes: 2 additions & 0 deletions demo/components/RefreshAndInfinite.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
},
infinite(done) {
console.log('infinite called..')
setTimeout(() => {
let start = this.bottom + 1
Expand Down
2 changes: 0 additions & 2 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import LoadMoreAndNoData from './components/LoadMoreAndNoData.vue'
import Snapping from './components/Snapping.vue'
import CustomSpinner from './components/CustomSpinner.vue'
import NoContent from './components/NoContent.vue'
import KeepAlive from './components/KeepAlive.vue'
import LoadMoreAndNoData2 from './components/LoadMoreAndNoData2.vue'

const routes = [
Expand All @@ -31,7 +30,6 @@ const routes = [
{ path: '/loadMoreAndNoData', component: LoadMoreAndNoData },
{ path: '/snapping', component: Snapping },
{ path: '/noContent', component: NoContent },
{ path: '/keepAlive', component: KeepAlive },
{ path: '/loadMoreAndNoData2', component: LoadMoreAndNoData2 }
]

Expand Down
4 changes: 2 additions & 2 deletions src/components/Scroller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
}
},
mounted() {
activated () {
this.container = document.getElementById(this.containerId)
this.container.style.width = this.w
this.container.style.height = this.h
Expand Down Expand Up @@ -385,7 +385,7 @@
}, 10);
},
destroyed() {
deactivated () {
clearInterval(this.resizeTimer);
if (this.infiniteTimer) clearInterval(this.infiniteTimer);
},
Expand Down

0 comments on commit 85c05e3

Please sign in to comment.