diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index d217897..1b5658f 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -27,7 +27,7 @@ 的文件 - +
  • {{ getFileName(file.name) }} @@ -216,7 +216,7 @@ function listToString(list, separator) { onMounted(() => { if (props.drag) { nextTick(() => { - const element = document.querySelector('.upload-file-list') + const element = proxy.$refs.uploadFileList?.$el || proxy.$refs.uploadFileList Sortable.create(element, { ghostClass: 'file-upload-darg', onEnd: (evt) => { diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue index 89cc790..caa0362 100644 --- a/src/components/ImageUpload/index.vue +++ b/src/components/ImageUpload/index.vue @@ -227,7 +227,7 @@ function listToString(list, separator) { onMounted(() => { if (props.drag) { nextTick(() => { - const element = document.querySelector('.el-upload-list') + const element = proxy.$refs.imageUpload?.$el?.querySelector('.el-upload-list') Sortable.create(element, { onEnd: (evt) => { const movedItem = fileList.value.splice(evt.oldIndex, 1)[0]