Initialize maxTotal/minTotal from props via watchers in DurationInput
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user