]> Repos - mime-chat/commitdiff
fix messageItem render bug
authorriqo <hernandeze2@xavier.edu>
Sat, 10 Oct 2020 22:03:28 +0000 (17:03 -0500)
committerriqo <hernandeze2@xavier.edu>
Sat, 10 Oct 2020 22:03:28 +0000 (17:03 -0500)
src/components/UI/UIDetails/messageItem.vue

index dda2b92fd12fde38c92d2b166eaf580cd5f69543..b0ecc3a85ba375b3378921489d3a3ed15e9850db 100644 (file)
@@ -5,7 +5,7 @@
     :transform = "startingOffset"
   >
     <rect
-      ref="bubble"
+      ref="bubbleTag"
       id="#bubble"
       x="30"
       y="10"
@@ -18,7 +18,7 @@
       font-size="14"
       font-family="SF Pro"
       id="#message"
-      ref="content"
+      ref="contentTag"
       :fill="textFill"
     >
       <tspan
@@ -67,6 +67,10 @@ import { defineComponent, computed, onMounted, ref, reactive, onBeforeMount } fr
 
       let textArr: string[] = reactive([]);
       const signature = ref("");
+      const msgID = ref(props.item.id);
+      const bubbleTag = ref(`bubble${msgID.value}`);
+      const contentTag = ref(`content${msgID.value}`);
+
 
       let bubble: any;
       let content: any;
@@ -131,8 +135,10 @@ import { defineComponent, computed, onMounted, ref, reactive, onBeforeMount } fr
       }
       createTextBox(props.item.content, 32);
       onMounted(async () => {
-          bubble = document.getElementById("#bubble");
-          content = document.getElementById("#message");
+          console.log(bubbleTag.value);
+          console.log(contentTag.value)
+          bubble = bubbleTag.value;
+          content = contentTag.value;
           await adjustRect();
           signaturePosition();
 
@@ -145,7 +151,9 @@ import { defineComponent, computed, onMounted, ref, reactive, onBeforeMount } fr
           signaturePosition,
           textArr,
           signature,
-          content
+          contentTag,
+          msgID,
+          bubbleTag
       }
 
   },