1 Commits

Author SHA1 Message Date
mashuo
7358a5b1b3 Pre Merge pull request !402 from mashuo/springboot3 2025-05-06 06:54:29 +00:00
2 changed files with 7 additions and 18 deletions

View File

@@ -84,7 +84,7 @@ export default {
type: Boolean,
default: false
},
// 拖动排序
// 拖动排序
drag: {
type: Boolean,
default: true
@@ -102,7 +102,7 @@ export default {
}
},
mounted() {
if (this.drag && !this.disabled) {
if (this.drag) {
this.$nextTick(() => {
const element = this.$refs.uploadFileList?.$el || this.$refs.uploadFileList
Sortable.create(element, {

View File

@@ -2,7 +2,6 @@
<div class="component-upload-image">
<el-upload
multiple
:disabled="disabled"
:action="uploadImgUrl"
list-type="picture-card"
:on-success="handleUploadSuccess"
@@ -23,7 +22,7 @@
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip && !disabled">
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
@@ -80,12 +79,7 @@ export default {
type: Boolean,
default: true
},
// 禁用组件(仅查看图片)
disabled: {
type: Boolean,
default: false
},
// 拖动排序
// 拖动排序
drag: {
type: Boolean,
default: true
@@ -106,7 +100,7 @@ export default {
}
},
mounted() {
if (this.drag && !this.disabled) {
if (this.drag) {
this.$nextTick(() => {
const element = this.$refs.imageUpload?.$el?.querySelector('.el-upload-list')
Sortable.create(element, {
@@ -245,17 +239,12 @@ export default {
<style scoped lang="scss">
// .el-upload--picture-card 控制加号部分
::v-deep.hide .el-upload--picture-card {
display: none;
display: none;
}
::v-deep .el-upload-list--picture-card.is-disabled + .el-upload--picture-card {
display: none !important;
}
// 去掉动画效果
::v-deep .el-list-enter-active,
::v-deep .el-list-leave-active {
transition: all 0s;
transition: all 0s;
}
::v-deep .el-list-enter, .el-list-leave-active {