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 1717 <a href =" http://packagequality.com/#?package=vue-virtual-scroll-list " >
1818 <img alt="Package quality" src="https://npm.packagequality.com/shield/vue-virtual-scroll-list.svg">
1919 </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 >
2320</p >
2421
2522## Table of contents
Original file line number Diff line number Diff line change 11/*!
2- * vue-virtual-scroll-list v2.0.6
2+ * vue-virtual-scroll-list v2.0.7
33 * open source under the MIT license
44 * https://github.com/tangbc/vue-virtual-scroll-list#readme
55 */
594594 this . $on ( EVENT_TYPE . SLOT , this . onSlotResized ) ;
595595 }
596596 } ,
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 ) ;
599600 } ,
600601 mounted : function mounted ( ) {
601602 // set position
605606 this . scrollToOffset ( this . offset ) ;
606607 }
607608 } ,
609+ beforeDestroy : function beforeDestroy ( ) {
610+ this . virtual . destroy ( ) ;
611+ } ,
608612 methods : {
609613 // set current scroll position to a expectant offset
610614 scrollToOffset : function scrollToOffset ( offset ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " vue-virtual-scroll-list" ,
3- "version" : " 2.0.6 " ,
3+ "version" : " 2.0.7 " ,
44 "description" : " A vue component support big amount data list with high scroll performance." ,
55 "main" : " dist/index.js" ,
66 "files" : [
Original file line number Diff line number Diff line change @@ -51,8 +51,9 @@ const VirtualList = Vue.component(NAME, {
5151 }
5252 } ,
5353
54- beforeDestroy ( ) {
55- this . virtual . destroy ( )
54+ // set back offset when use keep-alive
55+ activated ( ) {
56+ this . scrollToOffset ( this . virtual . offset )
5657 } ,
5758
5859 mounted ( ) {
@@ -64,6 +65,10 @@ const VirtualList = Vue.component(NAME, {
6465 }
6566 } ,
6667
68+ beforeDestroy ( ) {
69+ this . virtual . destroy ( )
70+ } ,
71+
6772 methods : {
6873 // set current scroll position to a expectant offset
6974 scrollToOffset ( offset ) {
You can’t perform that action at this time.
0 commit comments