From 08eb72e56868a8fbf3bfb849c93d6c69f7a5b6c0 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Sat, 22 Apr 2023 01:23:52 +0800 Subject: [PATCH] style: mp/WxReply objCache => tabCache --- src/views/mp/components/wx-reply/main.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/mp/components/wx-reply/main.vue b/src/views/mp/components/wx-reply/main.vue index 1ef9dde0..9a83b2fe 100644 --- a/src/views/mp/components/wx-reply/main.vue +++ b/src/views/mp/components/wx-reply/main.vue @@ -84,7 +84,7 @@ const reply = computed({ set: (val) => emit('update:modelValue', val) }) // 作为多个标签保存各自Reply的缓存 -const objCache = new Map() +const tabCache = new Map() // 采用独立的ref来保存当前tab,避免在watch标签变化,对reply进行赋值会产生了循环调用 const currentTab = ref(props.modelValue.type || ReplyType.Text) @@ -97,10 +97,10 @@ watch( return } - objCache.set(oldTab, unref(reply)) + tabCache.set(oldTab, unref(reply)) // 从缓存里面取出新tab内容,有则覆盖Reply,没有则创建空Reply - const temp = objCache.get(newTab) + const temp = tabCache.get(newTab) if (temp) { reply.value = temp } else {