Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
refactor: template optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Jul 2, 2018
1 parent 89fde45 commit b7d06f1
Showing 1 changed file with 25 additions and 27 deletions.
52 changes: 25 additions & 27 deletions src/page/news/newsDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,33 +72,31 @@
<ul class="m-box m-aln-center m-art-comments-tabs">
<li>{{ commentCount | formatNum }}条评论</li>
</ul>
<comment-item
v-for="(comment) in pinnedCom"
v-if="news.audit_status===0"
:key="`pinned-${comment.id}`"
:comment="comment"
:pinned="true"
@click="replyComment" />
<comment-item
v-for="(comment) in comments"
v-if="news.audit_status===0"
:key="`comment-${comment.id}`"
:comment="comment"
@click="replyComment" />
<div
v-if="news.audit_status===0"
class="m-box m-aln-center m-justify-center load-more-box">
<span
v-if="noMoreCom"
class="load-more-ph">---没有更多---</span>
<span
v-else
class="load-more-btn"
@click.stop="fetchNewsComments(maxComId)">
{{ fetchComing ? "加载中..." : "点击加载更多" }}
</span>
<!-- <button v-else class="load-more-btn" @click.stop="fetchNewsComments(maxComId)"></button> -->
</div>
<template v-if="news.audit_status === 0">
<comment-item
v-for="(comment) in pinnedCom"
:key="`pinned-${comment.id}`"
:comment="comment"
:pinned="true"
@click="replyComment" />
<comment-item
v-for="(comment) in comments"
:key="`comment-${comment.id}`"
:comment="comment"
@click="replyComment" />
<div class="m-box m-aln-center m-justify-center load-more-box">
<span
v-if="noMoreCom"
class="load-more-ph">---没有更多---</span>
<span
v-else
class="load-more-btn"
@click.stop="fetchNewsComments(maxComId)">
{{ fetchComing ? "加载中..." : "点击加载更多" }}
</span>
<!-- <button v-else class="load-more-btn" @click.stop="fetchNewsComments(maxComId)"></button> -->
</div>
</template>
</div>
</article-card>
</template>
Expand Down

0 comments on commit b7d06f1

Please sign in to comment.