Skip to content

Commit

Permalink
feat: fix zero loadDistance
Browse files Browse the repository at this point in the history
  • Loading branch information
AwesomeDevin committed Nov 7, 2023
1 parent b81de58 commit 978333d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions main/waterfall.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

<script>
import { isVNode } from 'vue'
import bus from './bus'
export default{
Expand Down Expand Up @@ -363,11 +362,10 @@ import bus from './bus'
const scrollHeight = this.height?this.root.scrollHeight : document.documentElement.offsetHeight
var diff = scrollHeight - scrollTop - self.clientHeight
self.$emit('scroll',{scrollHeight:scrollHeight,scrollTop:scrollTop,clientHeight:self.clientHeight,diff:diff,time:Date.now()})
if(diff <self.max&&self.loadmore&&scrollHeight>self.clientHeight){
if(diff <= self.max&&self.loadmore&&scrollHeight>self.clientHeight){
self.lastScrollTop = scrollTop
self.loadmore = false
console.log('loadmore1')
self.$emit('loadmore')
}
else if(diff>=self.max){
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<!-- <div id="app"> -->
<!-- <keep-alive> -->
<router-view />
<router-view />
<!-- </keep-alive> -->
<!-- </div> -->
</template>
Expand Down
1 change: 0 additions & 1 deletion src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
@scroll="scroll"
@finish="finish"
:height="'100vh'"
:loadDistance="0"
>
<div
class="cell-item"
Expand Down

0 comments on commit 978333d

Please sign in to comment.