mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] List: should not trigger load event when hidden (#751)
This commit is contained in:
parent
70fbdea35d
commit
ddbe338919
@ -39,7 +39,7 @@ export default {
|
||||
onLoad() {
|
||||
setTimeout(() => {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
let text = this.list.length + 1;
|
||||
const text = this.list.length + 1;
|
||||
this.list.push(text < 10 ? '0' + text : text);
|
||||
}
|
||||
this.loading = false;
|
||||
|
@ -79,7 +79,7 @@ export default create({
|
||||
const scrollerHeight = utils.getVisibleHeight(scroller);
|
||||
|
||||
/* istanbul ignore next */
|
||||
if (!scrollerHeight) {
|
||||
if (!scrollerHeight || utils.getComputedStyle(el).display === 'none') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -46,15 +46,15 @@ export default {
|
||||
x: 0,
|
||||
y: 0
|
||||
};
|
||||
if (this.value) {
|
||||
this.open();
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
if (this.getContainer) {
|
||||
this.move();
|
||||
}
|
||||
if (this.value) {
|
||||
this.open();
|
||||
}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user