fix(编辑器): 修复清空引用数据时未更新草稿的问题
在清空引用数据时调用clearQuoteData方法,确保同时更新草稿状态。修改了引用卡片关闭按钮的点击事件处理逻辑,使用新方法替代直接赋值null。
This commit is contained in:
parent
a405a3bd90
commit
0b634e8cdd
@ -704,6 +704,8 @@ function onSendMessage() {
|
||||
editor.value?.commands.clearContent(true)
|
||||
// 清空引用数据
|
||||
quoteData.value = null
|
||||
// 更新草稿
|
||||
onEditorChange()
|
||||
}
|
||||
}
|
||||
|
||||
@ -790,6 +792,17 @@ function onSubscribeQuote(data) {
|
||||
|
||||
// 保存引用数据
|
||||
quoteData.value = data
|
||||
// 更新草稿
|
||||
onEditorChange()
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空引用数据并更新草稿
|
||||
*/
|
||||
function clearQuoteData() {
|
||||
quoteData.value = null
|
||||
// 更新草稿
|
||||
onEditorChange()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -894,7 +907,7 @@ useEventBus([
|
||||
<div class="quote-card-content">
|
||||
<div class="quote-card-title">
|
||||
<span>{{ quoteData.title || ' ' }}</span>
|
||||
<n-icon size="18" class="quote-card-remove" :component="Close" @click="quoteData = null" />
|
||||
<n-icon size="18" class="quote-card-remove" :component="Close" @click="clearQuoteData" />
|
||||
</div>
|
||||
<div v-if="quoteData.image" class="quote-card-image">
|
||||
<img :src="quoteData.image" alt="引用图片" />
|
||||
|
Loading…
Reference in New Issue
Block a user