diff --git a/src/views/portal/qa/Answer.vue b/src/views/portal/qa/Answer.vue index 25de703d..499d2e5d 100644 --- a/src/views/portal/qa/Answer.vue +++ b/src/views/portal/qa/Answer.vue @@ -78,7 +78,7 @@
- {{ item.isAll ? '收起' : '全文' + {{ item.isAll ? '收起' : '全文' }}
@@ -755,12 +755,16 @@ export default { hideButtons() { this.btnsShowRowId = ''; }, + //展示全部 displayAll(item) { let content = ''; content = item.content.replace(/(\n){2,}/,'
'); item.content = content; - if (!item.isAll && item.content.length > 170) { + if (!item.isAll && item.content.length > 170 || !item.isAll && item.content.split("\n").length>5) { + if(!item.isAll && item.content.split("\n").length>5){ + return item.content.slice(0, 10) + "..."; + } return item.content.slice(0, 170) + "..."; } return item.content;