maxiaoxiao 10 сар өмнө
parent
commit
3769581c35

+ 18 - 0
src/views/aiModel/index.vue

@@ -42,9 +42,17 @@
             <img src="/static/images/aiModel/kefu.png" />
           </div>
           <div class="content">
+            <!-- breaks:是否将连续的换行符转换为<br>标签,默认值为false。
+            typographer:是否启用智能引号和破折号等Typographer功能,默认值为false。
+            linkify:是否将URL转换为链接,默认值为false。
+            highlight:是否启用代码高亮,默认值为true。 -->
             <VueMarkdown
               v-if="item.type == 'answer'"
+              class="markdowm"
               :source="item.content"
+              :breaks="true"
+              :linkify="true"
+              :highlight="false"
             ></VueMarkdown>
             <div v-else>
               <span v-if="item.data" class="tit">参考意见</span>
@@ -86,6 +94,7 @@
         clearable
         v-model="sendContent"
         @input="change_witch"
+        @keyup.enter.native="send"
         class="search"
         placeholder="请输入问题"
       ></el-input>
@@ -395,6 +404,15 @@ export default {
         color: #ffffff;
         line-height: 20px;
       }
+      .markdowm {
+        width: 100%;
+        word-break: break-word; /* 超出容器宽度时自动换行 */
+        white-space: pre-wrap; /* 保持空白符序列,但是正常地换行 */
+        // overflow-wrap: break-word;
+        /deep/ pre {
+          white-space: pre-wrap;
+        }
+      }
     }
     .counsel-left {
       margin-bottom: 30px;