Unverified 提交 ff3f3f26 authored 作者: 若依's avatar 若依 提交者: Gitee

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

Merge pull request !1013 from 稚屿/N/A
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
mounted() { mounted() {
if (this.drag) { if (this.drag) {
this.$nextTick(() => { this.$nextTick(() => {
const element = document.querySelector('.el-upload-list') const element = this.$refs.imageUpload?.$el?.querySelector('.el-upload-list')
Sortable.create(element, { Sortable.create(element, {
onEnd: (evt) => { onEnd: (evt) => {
const movedItem = this.fileList.splice(evt.oldIndex, 1)[0] const movedItem = this.fileList.splice(evt.oldIndex, 1)[0]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论