|
@@ -50,6 +50,10 @@ export default {
|
|
|
type: String,
|
|
|
default: '.png,.jpg,.jpeg'
|
|
|
},
|
|
|
+ acceptArray: {
|
|
|
+ type: Array,
|
|
|
+ default: ['image/jpeg', 'image/png', 'image/jpg']
|
|
|
+ },
|
|
|
disabled: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
@@ -88,10 +92,10 @@ export default {
|
|
|
this.isStopRun = true
|
|
|
return false
|
|
|
}
|
|
|
- const isJpgOrPng =
|
|
|
- file.type === 'image/jpeg' ||
|
|
|
- file.type === 'image/png' ||
|
|
|
- file.type === 'image/jpg'
|
|
|
+ const isJpgOrPng = this.acceptArray.includes(file.type)
|
|
|
+ // file.type === 'image/jpeg' ||
|
|
|
+ // file.type === 'image/png' ||
|
|
|
+ // file.type === 'image/jpg'
|
|
|
if (!isJpgOrPng) {
|
|
|
this.$message.error('你上传图片格式不正确!')
|
|
|
this.isStopRun = true
|
|
@@ -148,6 +152,7 @@ export default {
|
|
|
::v-deep .avatar-uploader.uploadDisabled {
|
|
|
.el-upload--text {
|
|
|
cursor: not-allowed;
|
|
|
+ background-color: #f7f7f7;
|
|
|
}
|
|
|
.el-upload:hover {
|
|
|
border-color: #d9d9d9;
|