Skip to content

Commit 08eb72e

Browse files
committed
style: mp/WxReply objCache => tabCache
1 parent d99f9e9 commit 08eb72e

File tree

1 file changed

+3
-3
lines changed
  • src/views/mp/components/wx-reply

1 file changed

+3
-3
lines changed

src/views/mp/components/wx-reply/main.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const reply = computed<Reply>({
8484
set: (val) => emit('update:modelValue', val)
8585
})
8686
// 作为多个标签保存各自Reply的缓存
87-
const objCache = new Map<ReplyType, Reply>()
87+
const tabCache = new Map<ReplyType, Reply>()
8888
// 采用独立的ref来保存当前tab,避免在watch标签变化,对reply进行赋值会产生了循环调用
8989
const currentTab = ref<ReplyType>(props.modelValue.type || ReplyType.Text)
9090
@@ -97,10 +97,10 @@ watch(
9797
return
9898
}
9999
100-
objCache.set(oldTab, unref(reply))
100+
tabCache.set(oldTab, unref(reply))
101101
102102
// 从缓存里面取出新tab内容,有则覆盖Reply,没有则创建空Reply
103-
const temp = objCache.get(newTab)
103+
const temp = tabCache.get(newTab)
104104
if (temp) {
105105
reply.value = temp
106106
} else {

0 commit comments

Comments
 (0)