mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-21 00:36:44 +08:00
评论回复,加载更多,,如果回复内容过多,最多显示3条,点击更多回复再刷3条
This commit is contained in:
@@ -113,7 +113,7 @@
|
||||
</div>
|
||||
<!--回复内容-->
|
||||
<div v-if="com.replyList && com.replyList.length>0">
|
||||
<div v-for="(reply,replyIdx) in com.replyList" :key="reply.id" v-if="com.showAll || replyIdx<3">
|
||||
<div v-for="(reply,replyIdx) in com.replyList" :key="reply.id" v-if="replyIdx<com.showNum">
|
||||
<div class="comment" :class="replyIdx===com.replyList.length-1 ? 'comment-last' : ''">
|
||||
<div class="comment-top">
|
||||
<div class="comment-author">
|
||||
@@ -159,7 +159,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!com.showAll && com.replyList.length>3" style="padding-left: 45px;padding-bottom: 10px;" @click="loadReplyMore(com)"><span style="color: #9e9e9e;cursor: pointer; border-radius: 5px;border:1px solid #cccccc;padding: 5px 10px;font-size: 14px;">加载更多>></span></div>
|
||||
<div v-if="com.replyList.length>com.showNum" style="padding-left: 45px;padding-bottom: 10px;" @click="loadReplyMore(com)"><span style="color: #9e9e9e;cursor: pointer; border-radius: 5px;border:1px solid #cccccc;padding: 5px 10px;font-size: 14px;">加载更多>></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -384,7 +384,8 @@
|
||||
},
|
||||
methods: {
|
||||
loadReplyMore(item){
|
||||
item.showAll=true;
|
||||
item.showNum=item.showNum+3;
|
||||
//item.showAll=true;
|
||||
},
|
||||
loadMore() {
|
||||
this.pageIndex +=1;
|
||||
@@ -455,6 +456,7 @@
|
||||
let ids=[];
|
||||
let allList=[];
|
||||
res.result.list.forEach(item=>{
|
||||
item.showNum=3;
|
||||
item.answers=item.replys;
|
||||
item.showAll=false;
|
||||
item.avatar='';
|
||||
|
||||
Reference in New Issue
Block a user