Skip to content

Commit

Permalink
fix type coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
crsct committed Sep 11, 2023
1 parent 36c5a43 commit 7513d78
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/QueryFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ const emits = defineEmits<{
const from = computed({
get: () => props.modelValue.from,
set: (x) => {
emits("update:modelValue", { ...props.modelValue, from: x });
x = Number(x);
if(!isNaN(x)) {
emits("update:modelValue", { ...props.modelValue, from: x });
}
},
});
const to = computed({
get: () => props.modelValue.to,
set: (x) => {
emits("update:modelValue", { ...props.modelValue, to: x });
x = Number(x);
if(!isNaN(x)) {
emits("update:modelValue", { ...props.modelValue, to: x });
}
},
});
</script>
Expand Down

0 comments on commit 7513d78

Please sign in to comment.