mirror of
https://github.com/yangzongzhuan/RuoYi-Cloud.git
synced 2025-06-05 04:29:00 +00:00
修复上传组件被多次引用拖动仅对第一个有效的问题
This commit is contained in:
parent
496d6113c4
commit
e64bb2d7be
@ -28,7 +28,7 @@
|
||||
</el-upload>
|
||||
|
||||
<!-- 文件列表 -->
|
||||
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||
<transition-group ref="uploadFileList" class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
||||
<el-link :href="file.url" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
@ -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) => {
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user