mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
easy mode setting validation check working
This commit is contained in:
parent
b6134141db
commit
0e02081fae
1 changed files with 14 additions and 3 deletions
|
|
@ -96,9 +96,6 @@ const data = reactive({
|
|||
isReqErr: false,
|
||||
settingErr: "",
|
||||
stepErr: "",
|
||||
checkValidity: computed(() => {
|
||||
setValidity();
|
||||
}),
|
||||
});
|
||||
|
||||
watch(
|
||||
|
|
@ -139,6 +136,18 @@ function setup() {
|
|||
setValidity();
|
||||
}
|
||||
|
||||
/**
|
||||
* @name listenToValidate
|
||||
* @description Setup the needed data for the component to work properly.
|
||||
* @returns {void}
|
||||
*/
|
||||
function listenToValidate(e) {
|
||||
setTimeout(() => {
|
||||
if (!e.target.closest('[data-is="form"]')) return;
|
||||
setValidity();
|
||||
}, 50);
|
||||
}
|
||||
|
||||
const buttonSave = {
|
||||
id: `easy-mode-${uuidv4()}`,
|
||||
text: "action_save",
|
||||
|
|
@ -166,10 +175,12 @@ onMounted(() => {
|
|||
setup();
|
||||
// I want updatInp to access event, data.base and the container attribut
|
||||
easyForm.useListenTempFields();
|
||||
window.addEventListener("input", listenToValidate);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
easyForm.useUnlistenTempFields();
|
||||
window.removeEventListener("input", listenToValidate);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue