From 31a351e1e45070d8dffa72dc7e4c3f62114050a2 Mon Sep 17 00:00:00 2001 From: WangHao <43278047@qq.com> Date: Fri, 2 Oct 2020 13:11:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=BB=9A=E5=8A=A8=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/bookmark/bookmark/index.vue | 42 +++++++++++++------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/ruoyi-ui/src/views/bookmark/bookmark/index.vue b/ruoyi-ui/src/views/bookmark/bookmark/index.vue index edefc8b2e..a411bb1d3 100644 --- a/ruoyi-ui/src/views/bookmark/bookmark/index.vue +++ b/ruoyi-ui/src/views/bookmark/bookmark/index.vue @@ -120,7 +120,7 @@

加载中...

-

没有更多了

+

没有更多了

@@ -277,7 +277,9 @@ height: "", }, listloading: false,//滚动加载提示 - datalistcount:500, + listnoMore: false, + total:0,//总条数 + noMore:false,//是否可以滚动瀑布流 } }, @@ -294,13 +296,7 @@ }, computed:{ /**list加载完毕就禁止滚动**/ - noMore() { - console.log(this.bookmarkList.length) - console.log(this.datalistcount) - // return this.bookmarkList.length >= this.datalistcount; - //TRUE 不滑动了 - return false; - }, + /**是否禁用滚动**/ disabled(){ return this.listloading || this.noMore @@ -355,9 +351,31 @@ /**滚动监控**/ load() { + //判断是否加载了所有数据 + this.queryParams.pageNum=this.queryParams.pageNum+1; + if (this.queryParams.pageNum*this.queryParams.pageSize>=this.total){ + //加载完毕了 禁止滚动 + this.noMore=true; + this.listnoMore=true; + return; + } + this.listloading = true - this.bookmarkList = this.bookmarkList.concat(this.bookmarkList, this.bookmarkList); - this.listloading = false + setTimeout(() =>{ + selectBymenuIdUserID(this.queryParams).then(response => { + if (response.rows.length!=0 && response.code == 200) { + this.bookmarkList = this.bookmarkList.concat(this.bookmarkList, response.rows); + this.total = response.total; + this.listloading = false + } else { + //加载完毕了 禁止滚动 + this.noMore=true; + this.listloading = false + } + }); + },1000); + + }, /**切换显示 全部 网页 文本 其他**/ @@ -553,7 +571,7 @@ /**编辑标签 开始**/ - .el-tag + .el-tag { + .el-tag { margin-left: 10px; }