From 333685fb9981fa466318655a31f72f0c849c2bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 9 Mar 2026 20:22:02 +0800 Subject: [PATCH] Initialize maxTotal/minTotal from props via watchers in DurationInput Co-Authored-By: Claude Opus 4.6 --- src/components/DurationInput.vue | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/components/DurationInput.vue b/src/components/DurationInput.vue index e91ada8..e644df3 100644 --- a/src/components/DurationInput.vue +++ b/src/components/DurationInput.vue @@ -392,6 +392,25 @@ async function createData() { } } +// Sync maxTotal/minTotal from props so calculateTotalSeconds can clamp +// and createData can initialize the display. +watch( + () => [props.max, props.updateMax], + ([max, updateMax]) => { + maxTotal.value = updateMax ?? max; + createData(); + }, + { immediate: true }, +); +watch( + () => [props.min, props.updateMin], + ([min, updateMin]) => { + minTotal.value = updateMin ?? min; + createData(); + }, + { immediate: true }, +); + // created emitter.on("reset", () => { createData();