|
@@ -45,18 +45,17 @@ const props = defineProps({
|
|
|
|
|
|
|
|
|
|
watch(() => props.modelValue, (newVal) => {
|
|
watch(() => props.modelValue, (newVal) => {
|
|
- console.log(newVal);
|
|
|
|
previewUrl.value = newVal;
|
|
previewUrl.value = newVal;
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- console.log(props.modelValue);
|
|
|
|
previewUrl.value = props.modelValue;
|
|
previewUrl.value = props.modelValue;
|
|
});
|
|
});
|
|
|
|
|
|
// const emit = defineEmits(["update:fileUrl"]);
|
|
// const emit = defineEmits(["update:fileUrl"]);
|
|
-const emit = defineEmits(["input"]);
|
|
|
|
|
|
+const emit = defineEmits(["input","update:modelValue"]);
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
const handlePictureCardPreview = (file: UploadFile) => {
|
|
const handlePictureCardPreview = (file: UploadFile) => {
|
|
@@ -80,8 +79,9 @@ function upload(file: any) {
|
|
fd.append("file", file.file);
|
|
fd.append("file", file.file);
|
|
fileUpload(fd).then(res => {
|
|
fileUpload(fd).then(res => {
|
|
previewUrl.value = res.data.previewUrl;
|
|
previewUrl.value = res.data.previewUrl;
|
|
|
|
+ console.log(previewUrl.value);
|
|
// emit("update:fileUrl", previewUrl.value);
|
|
// emit("update:fileUrl", previewUrl.value);
|
|
- emit("input", previewUrl.value);
|
|
|
|
|
|
+ emit("update:modelValue", previewUrl.value);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|