File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change 6767 },
6868 },
6969 props: {
70- distance: Number ,
70+ distance: {
71+ type: Number ,
72+ default: 100 ,
73+ },
7174 onInfinite: Function ,
7275 spinner: String ,
7376 },
74- ready () {
75- if (this .distance === undefined ) {
76- this .$set (' distance' , 100 );
77- }
78-
77+ mounted () {
7978 this .scrollParent = getScrollParent (this .$el );
8079
8180 this .scrollHandler = function scrollHandlerOriginal () {
9089
9190 setTimeout (this .scrollHandler , 1 );
9291 this .scrollParent .addEventListener (' scroll' , this .scrollHandler );
93- },
94- events: {
95- ' $InfiniteLoading:loaded ' : function loaded () {
92+
93+ this .$on (' $InfiniteLoading:loaded' , () => {
9694 this .isLoading = false ;
9795 this .isFirstLoad = false ;
98- },
99- ' $InfiniteLoading:complete ' : function complete () {
96+ });
97+ this . $on ( ' $InfiniteLoading:complete' , () => {
10098 this .isLoading = false ;
10199 this .isComplete = true ;
102100 this .scrollParent .removeEventListener (' scroll' , this .scrollHandler );
103- },
104- ' $InfiniteLoading:reset ' : function reset () {
101+ });
102+ this . $on ( ' $InfiniteLoading:reset' , () => {
105103 this .isLoading = false ;
106104 this .isComplete = false ;
107105 this .isFirstLoad = true ;
108106 this .scrollParent .addEventListener (' scroll' , this .scrollHandler );
109107 setTimeout (this .scrollHandler , 1 );
110- },
108+ });
111109 },
112110 destroyed () {
113111 if (! this .isComplete ) {
You can’t perform that action at this time.
0 commit comments