wangwei %!s(int64=4) %!d(string=hai) anos
pai
achega
14d8af0dbe
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      src/components/ChatFrame.vue

+ 3 - 3
src/components/ChatFrame.vue

@@ -84,7 +84,7 @@
               <div
                 class="message-content-text"
                 v-if="item.type === 'text'"
-                v-text="_parseText(item.msg)"
+                v-html="_parseText(item.msg)"
               ></div>
               <!-- 图片 -->
               <div
@@ -424,9 +424,9 @@ export default {
       const regex2 = /\[(.+?)\]/g;
       const codeList = text.match(regex2)
       console.log('[]',text.match(regex2))
-      let html = null
+      let html = text
       codeList.map((item,i) => {
-        html = text.replace(item, "<img style='width: 20px; height: 20px;vertical-align: sub;' src='" +
+        html = html.replace('/' + item +'/g', "<img style='width: 20px; height: 20px;vertical-align: sub;' src='" +
         this.getIconPic(item) +
         "' unicode = '" +
         item +