From 3abe5b43bde43a7cb8720bf4ef1c18c8adfa69bd Mon Sep 17 00:00:00 2001 From: qiang Date: Thu, 28 Jan 2021 14:56:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(App):=20=20=E4=BF=AE=E5=A4=8D=20uni.compres?= =?UTF-8?q?sImage=20=E4=BC=A0=E5=85=A5=E6=9C=AC=E5=9C=B0=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20question/115315?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/helpers/protocol/media/compress-image.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/core/helpers/protocol/media/compress-image.js diff --git a/src/core/helpers/protocol/media/compress-image.js b/src/core/helpers/protocol/media/compress-image.js new file mode 100644 index 000000000..16180d60f --- /dev/null +++ b/src/core/helpers/protocol/media/compress-image.js @@ -0,0 +1,11 @@ +import getRealPath from 'uni-platform/helpers/get-real-path' + +export const compressImage = { + src: { + type: String, + required: true, + validator (src, params) { + params.src = getRealPath(src) + } + } +} -- GitLab