Skip to content

Commit 1d7ddc9

Browse files
VanishMaxtangbc
authored andcommitted
Fix typos and misspelling mistakes
1 parent ad7aea6 commit 1d7ddc9

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ coverage
55
demos/dev/
66
demos/dev*/
77
demos/**/*.map
8+
.idea
9+
.vscode

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@
8888
default: 0
8989
},
9090
totop: {
91-
type: [Function, Boolean], // Boolean just disable for priviate.
91+
type: [Function, Boolean],
9292
default: false
9393
},
9494
tobottom: {
95-
type: [Function, Boolean], // Boolean just disable for priviate.
95+
type: [Function, Boolean],
9696
default: false
9797
},
9898
onscroll: {
99-
type: [Function, Boolean], // Boolean just disable for priviate.
99+
type: [Function, Boolean], // Boolean disables default behavior
100100
default: false
101101
},
102102
istable: {
@@ -118,7 +118,7 @@
118118
}
119119
},
120120

121-
// use changeProp to identify which prop change.
121+
// use changeProp to identify the prop change.
122122
watch: {
123123
size () {
124124
this.changeProp = 'size'
@@ -303,8 +303,8 @@
303303
const zone = this.getZone(overs)
304304
const bench = this.bench || this.remain
305305

306-
// for better performance, if scroll pass items within now bench, do not update.
307-
// and if overs is going to reach last item, we should render next zone immediately.
306+
// for better performance, if scroll passes items within the bench, do not update.
307+
// and if it's close to the last item, render next zone immediately.
308308
const shouldRenderNextZone = Math.abs(overs - delta.start - bench) === 1
309309
if (
310310
!shouldRenderNextZone &&
@@ -314,7 +314,7 @@
314314
return
315315
}
316316

317-
// we'd better make sure forceRender calls as less as possible.
317+
// make sure forceRender calls as less as possible.
318318
if (
319319
shouldRenderNextZone ||
320320
zone.start !== delta.start ||
@@ -326,7 +326,7 @@
326326
}
327327
},
328328

329-
// return the right zone info base on `start/index`.
329+
// return the right zone info based on `start/index`.
330330
getZone (index) {
331331
let start
332332
const delta = this.delta
@@ -350,8 +350,8 @@
350350
}
351351
},
352352

353-
// public method, force render ui list if we needed.
354-
// call this before the next repaint to get better performance.
353+
// public method, force render ui list if needed.
354+
// call this before the next rerender to get better performance.
355355
forceRender () {
356356
window.requestAnimationFrame(() => {
357357
this.$forceUpdate()
@@ -365,7 +365,7 @@
365365
}
366366
},
367367

368-
// return the scroll passed items count in variable.
368+
// return the scroll of passed items count in variable.
369369
getVarOvers (offset) {
370370
let low = 0
371371
let middle = 0
@@ -444,28 +444,28 @@
444444
return 0
445445
},
446446

447-
// return the variable paddingTop base current zone.
447+
// return the variable paddingTop based on current zone.
448448
// @todo: if set a large `start` before variable was calculated,
449449
// here will also case too much offset calculate when list is very large,
450450
// consider use estimate paddingTop in this case just like `getVarPaddingBottom`.
451451
getVarPaddingTop () {
452452
return this.getVarOffset(this.delta.start)
453453
},
454454

455-
// return the variable paddingBottom base current zone.
455+
// return the variable paddingBottom based on the current zone.
456456
getVarPaddingBottom () {
457457
const delta = this.delta
458458
const last = delta.total - 1
459459
if (delta.total - delta.end <= delta.keeps || delta.varLastCalcIndex === last) {
460460
return this.getVarOffset(last) - this.getVarOffset(delta.end)
461461
} else {
462-
// if unreached last zone or uncalculate real behind offset
463-
// return the estimate paddingBottom avoid too much calculate.
462+
// if unreached last zone or uncalculated real behind offset
463+
// return the estimate paddingBottom and avoid too much calculations.
464464
return (delta.total - delta.end) * (delta.varAverSize || this.size)
465465
}
466466
},
467467

468-
// retun the variable all heights use to judge reach bottom.
468+
// return the variable all heights use to judge reach bottom.
469469
getVarAllHeight () {
470470
const delta = this.delta
471471
if (delta.total - delta.end <= delta.keeps || delta.varLastCalcIndex === delta.total - 1) {
@@ -477,7 +477,7 @@
477477

478478
// public method, allow the parent update variable by index.
479479
updateVariable (index) {
480-
// clear/update all the offfsets and heights ahead of index.
480+
// clear/update all the offsets and heights ahead of index.
481481
this.getVarOffset(index, true)
482482
},
483483

@@ -502,12 +502,12 @@
502502
}
503503
},
504504

505-
// filter the shown items base on `start` and `end`.
505+
// filter the shown items based on `start` and `end`.
506506
filter (h) {
507507
const delta = this.delta
508508
const slots = this.$slots.default || []
509509

510-
// item-mode shoud judge from items prop.
510+
// item-mode should be decided from items prop.
511511
if (this.item || this.$scopedSlots.item) {
512512
delta.total = this.itemcount
513513
if (delta.keeps > delta.total) {
@@ -573,15 +573,15 @@
573573
style: {
574574
display: 'block',
575575
'padding-top': paddingTop + 'px',
576-
'padding-bottom': paddingBottom + 'px'
576+
'padding-bottom': paddingBottom + 'px',
577577
},
578578
class: this.wclass,
579579
attrs: {
580580
role: 'group'
581581
}
582582
}, list)
583583

584-
// page mode just render list, no wraper.
584+
// page mode just render list, no wrapper.
585585
if (this.pagemode || this.scrollelement) {
586586
return renderList
587587
}
@@ -590,7 +590,7 @@
590590
ref: 'vsl',
591591
style: {
592592
display: 'block',
593-
'overflow-y': this.size >= this.remain ? 'auto' : 'inital',
593+
'overflow-y': this.size >= this.remain ? 'auto' : 'initial',
594594
height: this.size * this.remain + 'px'
595595
},
596596
on: {

0 commit comments

Comments
 (0)