fix: 🐛 修复先渲染多图上传,再更改绑定数据时,多图不展示的问题
修复先渲染多图上传,再更改绑定数据时,多图不展示的问题
This commit is contained in:
1 parent
d17c4abfbf
commit
81b5f94c54
1 file changed
+7
@@ -213,5 +213,12 @@ const handlePreviewClose = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fileList.value = modelValue.value.map((url) => ({ url }) as UploadUserFile);
|
fileList.value = modelValue.value.map((url) => ({ url }) as UploadUserFile);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => modelValue.value,
|
||||||
|
(newVal) => {
|
||||||
|
fileList.value = newVal.map((url) => ({ url }) as UploadUserFile);
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
Reference in new issue
Block a user