From 4114e4ffc080194f25c2771ddff7682b74a4d018 Mon Sep 17 00:00:00 2001 From: MoeSnowyFox Date: Mon, 22 Sep 2025 22:41:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(plan):=E4=BC=98=E5=8C=96=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=A0=E5=B0=84=E5=92=8C=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除 planList 映射中未使用的 index 参数,简化代码逻辑。 调整 watch 回调执行时机,使用 flush: 'post' 确保在 DOM 更新后执行,并移除不必要的 nextTick 等待,直接调用防抖保存函数。 --- frontend/src/views/plan/index.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/plan/index.vue b/frontend/src/views/plan/index.vue index 5e6acc6..5b84e62 100644 --- a/frontend/src/views/plan/index.vue +++ b/frontend/src/views/plan/index.vue @@ -284,7 +284,7 @@ const initPlans = async () => { try { const response = await getPlans() if (response.index && response.index.length > 0) { - planList.value = response.index.map((item: any, index: number) => { + planList.value = response.index.map((item: any) => { const planId = item.uid const planData = response.data[planId] const planType = planData?.Info?.Type || 'MaaPlan' @@ -343,10 +343,11 @@ const getPlanTypeLabel = (planType: string) => watch( () => [currentPlanName.value, currentMode.value], - async () => { - await nextTick() - await debouncedSave() - } + () => { + // await nextTick() + debouncedSave() // 直接调用即可,无需等待 + }, + { flush: 'post' } ) watch(