Skip to content

Commit

Permalink
emit from watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteenkamp89 committed Mar 27, 2024
1 parent b81907f commit 568289c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/plugins/oSnap/components/Input/FileInput/FileInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const handleFileChange = (event: Event | DragEvent) => {
} else {
file.value = _file;
fileInputState.value = 'VALID';
emit('update:file', _file);
}
clearInputValue();
};
Expand All @@ -63,13 +62,19 @@ function clearInputValue() {
}
}
function toggleDropping() {
isDropping.value = !isDropping.value;
}
watch(file, newFile => {
if (newFile) {
emit('update:file', newFile);
}
});
watch(fileInputState, newState => {
emit('update:fileInputState', newState);
});
const toggleDropping = () => {
isDropping.value = !isDropping.value;
};
</script>

<template>
Expand Down

0 comments on commit 568289c

Please sign in to comment.