fix(demos): snapshot validated values before asynchronous submissions
This commit is contained in:
@@ -33,10 +33,11 @@ const isSubmitting = shallowRef(false);
|
||||
let timer: ReturnType<typeof setTimeout> | undefined;
|
||||
function submit() {
|
||||
if (!value.value || isInvalid.value || isSubmitting.value) return;
|
||||
const submittedValue = value.value;
|
||||
isSubmitting.value = true;
|
||||
// Simulate API call
|
||||
timer = setTimeout(() => {
|
||||
console.log("Time submitted:", { time: value.value });
|
||||
console.log("Time submitted:", { time: submittedValue });
|
||||
value.value = null;
|
||||
isSubmitting.value = false;
|
||||
}, 1500);
|
||||
|
||||
Reference in New Issue
Block a user