From e4f39e187dad5836af77414e313b8074894b026d Mon Sep 17 00:00:00 2001 From: rex Date: Wed, 12 Dec 2018 15:35:08 +0800 Subject: [PATCH] =?UTF-8?q?[new=20feature]=20SwitchCell:=20add=20new=20pro?= =?UTF-8?q?ps=20active-color=E3=80=81inactive-color=20(#1061)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/switch-cell/README.md | 2 ++ packages/switch-cell/index.ts | 2 ++ packages/switch-cell/index.wxml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/packages/switch-cell/README.md b/packages/switch-cell/README.md index 3541383a..f34c3c84 100644 --- a/packages/switch-cell/README.md +++ b/packages/switch-cell/README.md @@ -67,6 +67,8 @@ Page({ | loading | 是否为加载状态 | `Boolean` | `false` | | disabled | 是否为禁用状态 | `Boolean` | `false` | | size | 开关尺寸 | `String` | `26px` | +| active-color | 开关打开时的背景色 | `String` | `#1989fa` | +| inactive-color | 开关关闭时的背景色 | `String` | `#fff` | ### Event diff --git a/packages/switch-cell/index.ts b/packages/switch-cell/index.ts index 88385d3e..d4406562 100644 --- a/packages/switch-cell/index.ts +++ b/packages/switch-cell/index.ts @@ -9,6 +9,8 @@ VantComponent({ checked: Boolean, loading: Boolean, disabled: Boolean, + activeColor: String, + inactiveColor: String, size: { type: String, value: '26px' diff --git a/packages/switch-cell/index.wxml b/packages/switch-cell/index.wxml index 273d0f6d..38877c26 100644 --- a/packages/switch-cell/index.wxml +++ b/packages/switch-cell/index.wxml @@ -9,6 +9,8 @@ checked="{{ checked }}" loading="{{ loading }}" disabled="{{ disabled }}" + active-color="{{ activeColor }}" + inactive-color="{{ inactiveColor }}" custom-class="van-switch-cell__switch" bind:change="onChange" />