提交 e1a98239 编写于 作者: 雪洛's avatar 雪洛

fix(v3): 修复chooseImage传入字符串格式sizeType导致报错的Bug

上级 81b293e1
......@@ -13,7 +13,7 @@ export const chooseImage = {
}
},
'sizeType': {
type: Array,
type: [Array, String],
required: false,
default: SIZE_TYPES,
validator (sizeType, params) {
......@@ -21,6 +21,10 @@ export const chooseImage = {
const length = sizeType.length
if (!length) {
params.sizeType = SIZE_TYPES
} else if (typeof sizeType === 'string') {
if (!~SIZE_TYPES.indexOf(sizeType)) {
params.sizeType = SIZE_TYPES
}
} else {
for (let i = 0; i < length; i++) {
if (typeof sizeType[i] !== 'string' || !~SIZE_TYPES.indexOf(sizeType[i])) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册