提交 6701889b 编写于 作者: Mosher's avatar Mosher

列表加载更多逻辑调整

上级 af55a692
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
</#if> </#if>
</div> </div>
</#if> </#if>
<template v-if="isScorll">
<div v-if="totalRecord>items.length" class="loadmore">{{ this.$t('app.commonWords.loadmore') }}</div> <div v-if="totalRecord>items.length" class="loadmore">{{ this.$t('app.commonWords.loadmore') }}</div>
<div v-else class="loadmore">{{ this.$t('app.commonWords.nomore') }}</div> <div v-else class="loadmore">{{ this.$t('app.commonWords.nomore') }}</div>
</template>
</div> </div>
<div v-else> <div v-else>
{{ $t('app.commonWords.noData') }} {{ $t('app.commonWords.noData') }}
...@@ -177,6 +179,14 @@ ...@@ -177,6 +179,14 @@
*/ */
public isAddBehind:boolean = false; public isAddBehind:boolean = false;
/**
* 是否有滚动条
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public isScrollBar: boolean = false;
/** /**
* 排序方向 * 排序方向
* *
...@@ -225,6 +235,11 @@ ...@@ -225,6 +235,11 @@
*/ */
public afterMounted () { public afterMounted () {
this.$el.addEventListener('scroll', ()=> { this.$el.addEventListener('scroll', ()=> {
if(this.$el.scrollHeight > this.$el.clientHeight) {
this.isScorll = true;
} else {
this.isScorll = false;
}
if( this.$el.scrollTop + this.$el.clientHeight >= this.$el.scrollHeight) { if( this.$el.scrollTop + this.$el.clientHeight >= this.$el.scrollHeight) {
this.loadMore(); this.loadMore();
} }
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
padding: 10px; padding: 10px;
text-decoration: underline; text-decoration: underline;
color: #82bff7; color: #82bff7;
cursor: default;
} }
} }
.app-list-empty { .app-list-empty {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册