Commit bebee4b2 by lijiabin

【需求 17679】 perf: 优化组件

parent 067c7e80
......@@ -43,7 +43,7 @@
</div>
</div>
</el-popover>
<div class="flex flex-wrap gap-2">
<div class="flex flex-wrap gap-2 mt-2">
<el-tag
v-for="tag in selectedTags"
:key="tag.value"
......
......@@ -54,7 +54,16 @@ const initFileList = () => {
}
})
}
initFileList()
// 监听 modelValue 变化,重新初始化 fileList
watch(
() => modelValue.value,
(newVal) => {
if (newVal != undefined) {
initFileList()
}
},
{ immediate: true },
)
watch(fileList, (newVal) => {
if (isArrayOfModelValue) {
......@@ -87,7 +96,6 @@ const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
// 在这里处理上传逻辑
const handleChange = async (uploadFile: UploadUserFile, uploadFiles: UploadUserFile[]) => {
await nextTick()
if (hasReachedLimit.value) {
ElMessage.error(`最多上传${limit}个文件`)
uploadFiles.pop()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment