From 34956cf9d2a7922c660a10398e618a173f471068 Mon Sep 17 00:00:00 2001 From: qiang Date: Wed, 13 May 2020 11:21:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20uni.setTabBarStyle=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=20backgroundImage=E3=80=81backgroundRepeat=20=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/helpers/protocol/ui/tab-bar.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/helpers/protocol/ui/tab-bar.js b/src/core/helpers/protocol/ui/tab-bar.js index 0573d603..660cec89 100644 --- a/src/core/helpers/protocol/ui/tab-bar.js +++ b/src/core/helpers/protocol/ui/tab-bar.js @@ -1,6 +1,7 @@ import { getLen } from 'uni-shared' +import getRealPath from 'uni-platform/helpers/get-real-path' const indexValidator = { type: Number, @@ -30,6 +31,17 @@ export const setTabBarStyle = { backgroundColor: { type: String }, + backgroundImage: { + type: String, + validator (backgroundImage, params) { + if (backgroundImage && !(/^(linear|radial)-gradient\(.+?\);?$/.test(backgroundImage))) { + params.backgroundImage = getRealPath(backgroundImage) + } + } + }, + backgroundRepeat: { + type: String + }, borderStyle: { type: String, validator (borderStyle, params) { -- GitLab