Skip to content

Commit d751456

Browse files
authored
Merge branch 'main' into jmal
Signed-off-by: Bob Du <i@bobdu.cc>
2 parents 78be0ff + 6ecfbfc commit d751456

File tree

1 file changed

+6
-2
lines changed
  • src/views/chat/components/Message

1 file changed

+6
-2
lines changed

src/views/chat/components/Message/Text.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,24 @@ function addCopyEvents() {
8181
})
8282
}
8383
}
84+
8485
function removeCopyEvents() {
8586
if (textRef.value) {
8687
const copyBtn = textRef.value.querySelectorAll('.code-block-header__copy')
8788
copyBtn.forEach((btn) => {
88-
btn.removeEventListener('click', () => { })
89+
btn.removeEventListener('click', () => {})
8990
})
9091
}
9192
}
93+
9294
onMounted(() => {
9395
addCopyEvents()
9496
})
97+
9598
onUpdated(() => {
9699
addCopyEvents()
97100
})
101+
98102
onUnmounted(() => {
99103
removeCopyEvents()
100104
})
@@ -104,7 +108,7 @@ onUnmounted(() => {
104108
<div class="text-black" :class="wrapClass">
105109
<div ref="textRef" class="leading-relaxed break-words">
106110
<div v-if="!inversion" class="flex items-end">
107-
<div v-if="!asRawText" class="markdown-body" :class="{ 'markdown-body-generate': loading }" v-html="text" />
111+
<div v-if="!asRawText" class="w-full markdown-body" :class="{ 'markdown-body-generate': loading }" v-html="text" />
108112
<div v-else class="w-full whitespace-pre-wrap" v-text="text" />
109113
</div>
110114
<div v-else class="whitespace-pre-wrap" v-text="text" />

0 commit comments

Comments
 (0)