From 71e2c4c2a394383350f4c898d00c209b7e35f479 Mon Sep 17 00:00:00 2001 From: weinan2087 Date: Sat, 22 Oct 2022 15:13:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=94=B6=E8=B5=B7=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/portal/qa/Answer.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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;