Skip to content

Commit 7e17990

Browse files
committed
Update infinit-loading
1 parent c10b89c commit 7e17990

File tree

1 file changed

+9
-12
lines changed
  • example/src/views/infinite-loading

1 file changed

+9
-12
lines changed

example/src/views/infinite-loading/Main.vue

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
v-on:toupper="onScrollToUpper"
2323
v-on:tolower="onScrollToLower"
2424
>
25-
<div slot="footer" :style="{ visibilty: visibility }" class="loader"></div>
25+
<div slot="footer" class="loader"></div>
2626
</virtual-list>
2727
</div>
2828

@@ -62,18 +62,15 @@ export default {
6262
codeblock: Code
6363
},
6464
65+
created () {
66+
this.isLoading = false
67+
},
68+
6569
data () {
6670
return {
6771
items: getPageData(pageSize, 0),
6872
itemComponent: Item,
6973
isShowView: DEFAULT_TAB === TAB_TYPE.VIEW,
70-
showLoading: false
71-
}
72-
},
73-
74-
computed: {
75-
visibility () {
76-
return this.showLoading ? '' : 'hidden'
7774
}
7875
},
7976
@@ -89,16 +86,16 @@ export default {
8986
onScrollToLower () {
9087
console.log('at bottom')
9188
92-
if (this.showLoading) {
89+
if (this.isLoading) {
9390
return
9491
}
9592
96-
this.showLoading = true
93+
this.isLoading = true
9794
9895
setTimeout(() => {
99-
this.showLoading = false
96+
this.isLoading = false
10097
this.items = this.items.concat(getPageData(pageSize, this.items.length))
101-
}, 800);
98+
}, 500);
10299
}
103100
}
104101
}

0 commit comments

Comments
 (0)