Fix the issue of unable to copy code blocks in new messages.
This commit is contained in:
@@ -23,8 +23,10 @@ const contentHtml = ref('')
|
|||||||
|
|
||||||
const contentElm = ref(null)
|
const contentElm = ref(null)
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(async () => {
|
||||||
contentHtml.value = props.message.message ? md.render(props.message.message) : ''
|
contentHtml.value = props.message.message ? md.render(props.message.message) : ''
|
||||||
|
await nextTick()
|
||||||
|
bindCopyCodeToButtons()
|
||||||
})
|
})
|
||||||
|
|
||||||
const bindCopyCodeToButtons = () => {
|
const bindCopyCodeToButtons = () => {
|
||||||
@@ -49,10 +51,7 @@ const bindCopyCodeToButtons = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
bindCopyCodeToButtons()
|
console.log('mounted')
|
||||||
})
|
|
||||||
|
|
||||||
onUpdated(() => {
|
|
||||||
bindCopyCodeToButtons()
|
bindCopyCodeToButtons()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user