mirror of https://github.com/ElemeFE/element
Avatar: fix browser compatibility for IE
As IE doesn't support `Array.prototype.includes`, it will throw error: `Object doesn't support property or method 'includes'`pull/21368/head
parent
492ab00ad7
commit
5cebd18fce
|
@ -7,7 +7,7 @@ export default {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
validator(val) {
|
validator(val) {
|
||||||
if (typeof val === 'string') {
|
if (typeof val === 'string') {
|
||||||
return ['large', 'medium', 'small'].includes(val);
|
return ['large', 'medium', 'small'].indexOf(val) >= 0;
|
||||||
}
|
}
|
||||||
return typeof val === 'number';
|
return typeof val === 'number';
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'circle',
|
default: 'circle',
|
||||||
validator(val) {
|
validator(val) {
|
||||||
return ['circle', 'square'].includes(val);
|
return ['circle', 'square'].indexOf(val) >= 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
icon: String,
|
icon: String,
|
||||||
|
|
Loading…
Reference in New Issue