From 9c695b19fc896c497c20bda6089f824c1705836c Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Mon, 28 Feb 2022 21:12:42 +0800 Subject: [PATCH] 添加md预览弹窗 --- src/components/group/articleListScorll.vue | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/components/group/articleListScorll.vue b/src/components/group/articleListScorll.vue index c18502a..f93c89e 100644 --- a/src/components/group/articleListScorll.vue +++ b/src/components/group/articleListScorll.vue @@ -1,10 +1,16 @@ <template> <div> <div v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" :infinite-scroll-distance="10"> - <div v-for="temp in data"> - <newArticle v-bind="temp"></newArticle> + <div class="mySecret" v-if="data.length==0"> + <p>空空如也..</p> + </div> + + <div v-for="(temp,index) in data" > + <newArticle v-bind="temp" :index="index"></newArticle> <!-- <box5 v-bind="temp"></box5> --> </div> + + <div v-if="loading && !busy" class="demo-loading-container"> <a-spin /> </div> @@ -12,7 +18,7 @@ <a-row type="flex" justify="center"> <div style="position:fixed;bottom: 10px;" id="dddadf"> <a-pagination @change="onChange" :showQuickJumper="true" :size="size" v-model="current" - :defaultPageSize="10" :pageSize="pageSize" :total="total" /> + :defaultPageSize="defaultPageSize" :pageSize="pageSize" :total="total" /> </div> </a-row> @@ -61,6 +67,7 @@ directives: { infiniteScroll }, + data() { return { typeId: "", @@ -69,8 +76,9 @@ busy: false, size: "small", total: 1, - pageSize: 1, + pageSize: 10, current: 1, + defaultPageSize:10 }; }, watch: { @@ -81,10 +89,9 @@ }, typeId: function(newValue, oldValue) { this.busy = true; - this.$message.info('loading',0.3); + this.$message.info('loading', 0.3); this.onChange(1); - } - + }, }, activated() { window.addEventListener('scroll', this); @@ -95,6 +102,7 @@ beforeMount() { queryBlogArticleList({ pageNo: this.current, + pageSize:this.pageSize, typeId: this.typeId }).then((res) => { this.total = Number(res.data.total) @@ -108,6 +116,7 @@ this.current = current; queryBlogArticleList({ pageNo: current, + pageSize:this.pageSize, typeId: this.typeId }).then((res) => { this.busy = false; @@ -123,6 +132,7 @@ queryBlogArticleList({ pageNo: this.current + 1, + pageSize:this.pageSize, typeId: this.typeId }).then((res) => { -- Gitblit v1.9.1