We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d99f9e9 commit 08eb72eCopy full SHA for 08eb72e
src/views/mp/components/wx-reply/main.vue
@@ -84,7 +84,7 @@ const reply = computed<Reply>({
84
set: (val) => emit('update:modelValue', val)
85
})
86
// 作为多个标签保存各自Reply的缓存
87
-const objCache = new Map<ReplyType, Reply>()
+const tabCache = new Map<ReplyType, Reply>()
88
// 采用独立的ref来保存当前tab,避免在watch标签变化,对reply进行赋值会产生了循环调用
89
const currentTab = ref<ReplyType>(props.modelValue.type || ReplyType.Text)
90
@@ -97,10 +97,10 @@ watch(
97
return
98
}
99
100
- objCache.set(oldTab, unref(reply))
+ tabCache.set(oldTab, unref(reply))
101
102
// 从缓存里面取出新tab内容,有则覆盖Reply,没有则创建空Reply
103
- const temp = objCache.get(newTab)
+ const temp = tabCache.get(newTab)
104
if (temp) {
105
reply.value = temp
106
} else {
0 commit comments