forked from verdnatura/salix-front
Delay 100ms form model watcher
This commit is contained in:
parent
4731bdbabd
commit
7835867325
|
@ -75,9 +75,12 @@ onMounted(async () => {
|
||||||
await fetch();
|
await fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disparamos el watcher del form después de que se haya cargado la data inicial, si así se desea
|
// Si así se desea disparamos el watcher del form después de 100ms, asi darle tiempo de que se haya cargado la data inicial
|
||||||
|
// para evitar que detecte cambios cuando es data inicial default
|
||||||
if ($props.observeFormChanges) {
|
if ($props.observeFormChanges) {
|
||||||
startFormWatcher();
|
setTimeout(() => {
|
||||||
|
startFormWatcher();
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -128,7 +131,7 @@ async function save() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const body = $props.mapper ? $props.mapper(formData.value) : formData.value;
|
const body = $props.mapper ? $props.mapper(formData.value) : formData.value;
|
||||||
let response
|
let response;
|
||||||
if ($props.urlCreate) {
|
if ($props.urlCreate) {
|
||||||
response = await axios.post($props.urlCreate, body);
|
response = await axios.post($props.urlCreate, body);
|
||||||
notify('globals.dataCreated', 'positive');
|
notify('globals.dataCreated', 'positive');
|
||||||
|
|
Loading…
Reference in New Issue