Skip to content

Commit

Permalink
fix: set value null
Browse files Browse the repository at this point in the history
  • Loading branch information
Noval Oktavio committed Oct 28, 2021
1 parent 0faac5a commit d88d3ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/VFileUpload/VFileUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ const setInitialValue = (val: any) => {
hasInitialValue.value = true;
previewURL.value = URL.createObjectURL(innerValue.value);
}
if (!val) {
innerValue.value = null;
previewURL.value = null;
hasInitialValue.value = false;
}
};
const hasFile = computed(() => {
Expand All @@ -255,7 +261,6 @@ const fileURL = computed(
watch(
value,
(val) => {
console.log('value', val);
setInitialValue(val);
},
{immediate: true},
Expand All @@ -264,7 +269,6 @@ watch(
watch(
modelValue,
(val) => {
console.log('modelValue', val);
setInitialValue(val);
},
{immediate: true},
Expand Down

0 comments on commit d88d3ea

Please sign in to comment.