diff --git a/src/components/Portal/comments.vue b/src/components/Portal/comments.vue index 68017b34..19c57bb5 100644 --- a/src/components/Portal/comments.vue +++ b/src/components/Portal/comments.vue @@ -96,7 +96,7 @@
- {{displayAll(com)}} + {{com.isAll?'收起':'全文'}} @@ -137,7 +137,7 @@
- {{displayAll(reply)}} + {{reply.isAll?'收起':'全文'}} @@ -532,7 +532,9 @@ }, //展示全部 displayAll(item) { - //console.log(item,'item'); + let content = ''; + content = item.content.replace(/(\n){2,}/,'
'); + item.content = content; if(!item.isAll && item.content && item.content.length > 170) { return item.content.slice(0, 170) + "..."; } diff --git a/src/views/portal/qa/Answer.vue b/src/views/portal/qa/Answer.vue index b5d4f305..70961039 100644 --- a/src/views/portal/qa/Answer.vue +++ b/src/views/portal/qa/Answer.vue @@ -89,7 +89,8 @@
-
{{ displayAll(item) }} +
+ {{ item.isAll ? '收起' : '全文' }}
@@ -146,7 +147,7 @@
- {{ displayAll(con) }} + {{ con.isAll ? '收起' : '全文' }} @@ -189,7 +190,7 @@
- {{ displayAll(row) }} + {{ row.isAll ? '收起' : '全文' }} @@ -714,6 +715,9 @@ export default { }, //展示全部 displayAll(item) { + let content = ''; + content = item.content.replace(/(\n){2,}/,'
'); + item.content = content; if (!item.isAll && item.content.length > 170) { return item.content.slice(0, 170) + "..."; }