From e1a98239049152558f6dcac8695e08668ec09949 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Tue, 10 Dec 2019 11:41:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(v3):=20=E4=BF=AE=E5=A4=8DchooseImage?= =?UTF-8?q?=E4=BC=A0=E5=85=A5=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?sizeType=E5=AF=BC=E8=87=B4=E6=8A=A5=E9=94=99=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/helpers/protocol/media/choose-image.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/helpers/protocol/media/choose-image.js b/src/core/helpers/protocol/media/choose-image.js index 46a86f71..09a55e14 100644 --- a/src/core/helpers/protocol/media/choose-image.js +++ b/src/core/helpers/protocol/media/choose-image.js @@ -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])) { -- GitLab