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 181181 lastItem () {
182182 return this .range >= this .pages ? this .pages : this .range - this .afterDots
183183 },
184+ itemsAmount () {
185+ return this .pages < this .computedLimit ? this .pages : this .computedLimit
186+ },
184187 items () {
185188 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 )
187190 } else {
188- return Array .from ({length: this .computedLimit }, (v , i ) => {
191+ return Array .from ({length: this .itemsAmount }, (v , i ) => {
189192 return this .lastItem - i
190193 }).reverse ()
191194 }
192195 }
193196 },
194197 methods: {
195198 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
199201 },
200202 setPage (number ) {
201203 if (number !== this .activePage ) {
You can’t perform that action at this time.
0 commit comments