File tree Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 17
17
<a href =" http://packagequality.com/#?package=vue-virtual-scroll-list " >
18
18
<img alt="Package quality" src="https://npm.packagequality.com/shield/vue-virtual-scroll-list.svg">
19
19
</a >
20
- <a href =" https://opensource.org/licenses/MIT " >
21
- <img alt="License" src="https://img.shields.io/npm/l/vue-virtual-scroll-list.svg">
22
- </a >
23
20
</p >
24
21
25
22
## Table of contents
Original file line number Diff line number Diff line change 1
1
/*!
2
- * vue-virtual-scroll-list v2.0.6
2
+ * vue-virtual-scroll-list v2.0.7
3
3
* open source under the MIT license
4
4
* https://github.com/tangbc/vue-virtual-scroll-list#readme
5
5
*/
594
594
this . $on ( EVENT_TYPE . SLOT , this . onSlotResized ) ;
595
595
}
596
596
} ,
597
- beforeDestroy : function beforeDestroy ( ) {
598
- this . virtual . destroy ( ) ;
597
+ // set back offset when use keep-alive
598
+ activated : function activated ( ) {
599
+ this . scrollToOffset ( this . virtual . offset ) ;
599
600
} ,
600
601
mounted : function mounted ( ) {
601
602
// set position
605
606
this . scrollToOffset ( this . offset ) ;
606
607
}
607
608
} ,
609
+ beforeDestroy : function beforeDestroy ( ) {
610
+ this . virtual . destroy ( ) ;
611
+ } ,
608
612
methods : {
609
613
// set current scroll position to a expectant offset
610
614
scrollToOffset : function scrollToOffset ( offset ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-virtual-scroll-list" ,
3
- "version" : " 2.0.6 " ,
3
+ "version" : " 2.0.7 " ,
4
4
"description" : " A vue component support big amount data list with high scroll performance." ,
5
5
"main" : " dist/index.js" ,
6
6
"files" : [
Original file line number Diff line number Diff line change @@ -51,8 +51,9 @@ const VirtualList = Vue.component(NAME, {
51
51
}
52
52
} ,
53
53
54
- beforeDestroy ( ) {
55
- this . virtual . destroy ( )
54
+ // set back offset when use keep-alive
55
+ activated ( ) {
56
+ this . scrollToOffset ( this . virtual . offset )
56
57
} ,
57
58
58
59
mounted ( ) {
@@ -64,6 +65,10 @@ const VirtualList = Vue.component(NAME, {
64
65
}
65
66
} ,
66
67
68
+ beforeDestroy ( ) {
69
+ this . virtual . destroy ( )
70
+ } ,
71
+
67
72
methods : {
68
73
// set current scroll position to a expectant offset
69
74
scrollToOffset ( offset ) {
You can’t perform that action at this time.
0 commit comments