Initialize maxTotal/minTotal from props via watchers in DurationInput

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 20:22:02 +08:00
parent a669c8e98e
commit 333685fb99

View File

@@ -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 // created
emitter.on("reset", () => { emitter.on("reset", () => {
createData(); createData();