File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,9 @@ Vue.component('virtual-list', {
100
100
if ( delta . page_type === 'PREV' ) {
101
101
// already the first page
102
102
if ( delta . start_index === 0 ) {
103
- list = items . slice ( 0 , this . amount ) ;
103
+ list = items . filter ( ( item , index ) => {
104
+ return index >= 0 && index < this . amount ;
105
+ } ) ;
104
106
} else {
105
107
list = items . filter ( ( item , index ) => {
106
108
if ( index === delta . start_index - this . amount ) {
@@ -157,20 +159,15 @@ Vue.component('virtual-list', {
157
159
} ,
158
160
159
161
beforeMount ( ) {
160
- this . $options . delta . view_height = this . remain * this . unit ;
161
- } ,
162
-
163
- mounted ( ) {
164
162
let delta = this . $options . delta ;
165
163
delta . joints = Math . ceil ( this . remain / 2 ) ;
164
+ delta . view_height = this . remain * this . unit ;
166
165
delta . bench_padding = delta . joints * this . unit ;
167
166
} ,
168
167
169
- beforeUpdate ( ) { } ,
170
-
171
168
updated ( ) {
172
- let delta = this . $options . delta ;
173
169
window . requestAnimationFrame ( ( ) => {
170
+ let delta = this . $options . delta ;
174
171
this . $refs . container . scrollTop = delta . padding_top + delta . bench_padding ;
175
172
} ) ;
176
173
} ,
You can’t perform that action at this time.
0 commit comments