update method name
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<form :id="id" @submit.prevent="handleSubmit">
|
<form :id="id" @submit.prevent="submit">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
@@ -36,7 +36,7 @@ watch(
|
|||||||
/**
|
/**
|
||||||
* Handle the user submitting the form.
|
* Handle the user submitting the form.
|
||||||
*/
|
*/
|
||||||
const handleSubmit = async function () {
|
const submit = async function () {
|
||||||
inputs = Array.from(document.querySelectorAll(`#${id} input`));
|
inputs = Array.from(document.querySelectorAll(`#${id} input`));
|
||||||
|
|
||||||
for (let i = inputs.length - 1; i >= 0; i--) {
|
for (let i = inputs.length - 1; i >= 0; i--) {
|
||||||
@@ -71,5 +71,5 @@ const enableFormInputs = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
provide(props.formId, props.modelValue);
|
provide(props.formId, props.modelValue);
|
||||||
defineExpose({ handleSubmit });
|
defineExpose({ submit });
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handleSubmit();
|
// handleSubmit();
|
||||||
formObject.value.handleSubmit();
|
formObject.value.submit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user