panhui hace 3 años
padre
commit
c487bd57a3
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/components/ChatInfo.vue

+ 2 - 1
src/components/ChatInfo.vue

@@ -13,7 +13,7 @@
                     :width="imgWidth"
                     :width="imgWidth"
                     :height="imgHeight"
                     :height="imgHeight"
                 ></van-image>
                 ></van-image>
-                <div class="chat-message" v-else-if="type === 'text'">{{ body.msg }}</div>
+                <div class="chat-message" v-else-if="type === 'text'" v-html="body.msg"></div>
                 <van-image
                 <van-image
                     :src="attach.url"
                     :src="attach.url"
                     @click="preview(attach.url)"
                     @click="preview(attach.url)"
@@ -96,6 +96,7 @@ const body = computed(() => {
             _back = { msg: props.info.body.toString() };
             _back = { msg: props.info.body.toString() };
         }
         }
     }
     }
+    _back.msg = _back.msg.replace(/\n/g, '<br/>');
 
 
     return _back;
     return _back;
 });
 });