diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue index 557e1288..ad28ca02 100644 --- a/ruoyi-ui/src/components/FileUpload/index.vue +++ b/ruoyi-ui/src/components/FileUpload/index.vue @@ -28,7 +28,7 @@ - +
  • {{ getFileName(file.name) }} @@ -104,7 +104,7 @@ export default { mounted() { if (this.drag) { this.$nextTick(() => { - const element = document.querySelector('.upload-file-list') + const element = this.$refs.uploadFileList?.$el || this.$refs.uploadFileList Sortable.create(element, { ghostClass: 'file-upload-darg', onEnd: (evt) => { diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue index 02bdaa63..8520b830 100644 --- a/ruoyi-ui/src/components/ImageUpload/index.vue +++ b/ruoyi-ui/src/components/ImageUpload/index.vue @@ -102,7 +102,7 @@ export default { mounted() { if (this.drag) { this.$nextTick(() => { - const element = document.querySelector('.el-upload-list') + const element = this.$refs.imageUpload?.$el?.querySelector('.el-upload-list') Sortable.create(element, { onEnd: (evt) => { const movedItem = this.fileList.splice(evt.oldIndex, 1)[0]