Skip to content

Commit c10b89c

Browse files
committed
Use visibility
1 parent 20f4351 commit c10b89c

File tree

1 file changed

+10
-4
lines changed
  • example/src/views/infinite-loading

1 file changed

+10
-4
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
:data-component="itemComponent"
2121

2222
v-on:toupper="onScrollToUpper"
23-
:upper-threshold="50"
2423
v-on:tolower="onScrollToLower"
25-
:lower-threshold="50"
2624
>
27-
<div slot="footer" v-show="showLoading" class="loader"></div>
25+
<div slot="footer" :style="{ visibilty: visibility }" class="loader"></div>
2826
</virtual-list>
2927
</div>
3028

@@ -73,16 +71,24 @@ export default {
7371
}
7472
},
7573
74+
computed: {
75+
visibility () {
76+
return this.showLoading ? '' : 'hidden'
77+
}
78+
},
79+
7680
methods: {
7781
onTabChange (type) {
7882
this.isShowView = type === TAB_TYPE.VIEW
7983
},
8084
8185
onScrollToUpper () {
82-
console.log('to upper')
86+
console.log('at top')
8387
},
8488
8589
onScrollToLower () {
90+
console.log('at bottom')
91+
8692
if (this.showLoading) {
8793
return
8894
}

0 commit comments

Comments
 (0)