瀏覽代碼

!1013 修复图片上传组件在同一页面中被多次引用时,仅有第一个组件拖拽功能生效的问题
Merge pull request !1013 from 稚屿/N/A

若依 2 周之前
父節點
當前提交
ff3f3f2631
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      ruoyi-ui/src/components/ImageUpload/index.vue

+ 1 - 1
ruoyi-ui/src/components/ImageUpload/index.vue

@@ -104,7 +104,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]