File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 181
181
lastItem () {
182
182
return this .range >= this .pages ? this .pages : this .range - this .afterDots
183
183
},
184
+ itemsAmount () {
185
+ return this .pages < this .computedLimit ? this .pages : this .computedLimit
186
+ },
184
187
items () {
185
188
if (this .activePage - this .maxPrevItems <= 1 ) {
186
- return Array .from ({ length: this .computedLimit }, (v , i ) => i + 1 )
189
+ return Array .from ({ length: this .itemsAmount }, (v , i ) => i + 1 )
187
190
} else {
188
- return Array .from ({length: this .computedLimit }, (v , i ) => {
191
+ return Array .from ({length: this .itemsAmount }, (v , i ) => {
189
192
return this .lastItem - i
190
193
}).reverse ()
191
194
}
192
195
}
193
196
},
194
197
methods: {
195
198
onWrapperResize (el ) {
196
- el .clientWidth > 600 ? this .rwd = this .size :
197
- el .clientWidth > 400 ?
198
- this .rwd = ' md' : this .rwd = ' sm'
199
+ const responsiveSize = el .clientWidth > 400 ? ' md' : ' sm'
200
+ this .rwd = el .clientWidth > 600 ? this .size : responsiveSize
199
201
},
200
202
setPage (number ) {
201
203
if (number !== this .activePage ) {
You can’t perform that action at this time.
0 commit comments