feat(DropdownMenu): adjust default color to @red (#3725)

This commit is contained in:
neverland 2020-11-02 19:25:38 +08:00 committed by GitHub
parent 71bd97d8c5
commit d6cb2b61a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 11 deletions

View File

@ -15,6 +15,7 @@
size="24px" size="24px"
style="height: 26px" style="height: 26px"
checked="{{ switch1 }}" checked="{{ switch1 }}"
active-color="#ee0a24"
bind:change="onSwitch1Change" bind:change="onSwitch1Change"
/> />
</van-cell> </van-cell>
@ -24,18 +25,21 @@
size="24px" size="24px"
style="height: 26px" style="height: 26px"
checked="{{ switch2 }}" checked="{{ switch2 }}"
active-color="#ee0a24"
bind:change="onSwitch2Change" bind:change="onSwitch2Change"
/> />
</van-cell> </van-cell>
<van-button type="info" block bind:click="onConfirm"> <view style="padding: 5px 16px;">
确定 <van-button type="danger" block round bind:click="onConfirm">
</van-button> 确认
</van-button>
</view>
</van-dropdown-item> </van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</demo-block> </demo-block>
<demo-block custom-class="white" title="自定义选中状态颜色"> <demo-block custom-class="white" title="自定义选中状态颜色">
<van-dropdown-menu active-color="#ee0a24"> <van-dropdown-menu active-color="#1989fa">
<van-dropdown-item value="{{ value1 }}" options="{{ option1 }}" /> <van-dropdown-item value="{{ value1 }}" options="{{ option1 }}" />
<van-dropdown-item value="{{ value2 }}" options="{{ option2 }}" /> <van-dropdown-item value="{{ value2 }}" options="{{ option2 }}" />
</van-dropdown-menu> </van-dropdown-menu>

View File

@ -632,11 +632,11 @@
@dropdown-menu-background-color: @white; @dropdown-menu-background-color: @white;
@dropdown-menu-title-font-size: 15px; @dropdown-menu-title-font-size: 15px;
@dropdown-menu-title-text-color: @text-color; @dropdown-menu-title-text-color: @text-color;
@dropdown-menu-title-active-text-color: @blue; @dropdown-menu-title-active-text-color: @red;
@dropdown-menu-title-disabled-text-color: @gray-6; @dropdown-menu-title-disabled-text-color: @gray-6;
@dropdown-menu-title-padding: 0 @padding-xs; @dropdown-menu-title-padding: 0 @padding-xs;
@dropdown-menu-title-line-height: 18px; @dropdown-menu-title-line-height: 18px;
@dropdown-menu-option-active-color: @blue; @dropdown-menu-option-active-color: @red;
// IndexAnchor // IndexAnchor
@index-anchor-padding: 0 @padding-md; @index-anchor-padding: 0 @padding-md;

View File

@ -53,6 +53,7 @@ Page({
size="24px" size="24px"
style="height: 26px" style="height: 26px"
checked="{{ switch1 }}" checked="{{ switch1 }}"
active-color="#ee0a24"
bind:change="onSwitch1Change" bind:change="onSwitch1Change"
/> />
</van-cell> </van-cell>
@ -62,12 +63,15 @@ Page({
size="24px" size="24px"
style="height: 26px" style="height: 26px"
checked="{{ switch2 }}" checked="{{ switch2 }}"
active-color="#ee0a24"
bind:change="onSwitch2Change" bind:change="onSwitch2Change"
/> />
</van-cell> </van-cell>
<van-button type="info" block bind:click="onConfirm"> <view style="padding: 5px 16px;">
确定 <van-button type="danger" block round bind:click="onConfirm">
</van-button> 确认
</van-button>
</view>
</van-dropdown-item> </van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
``` ```
@ -103,7 +107,7 @@ Page({
### 自定义选中状态颜色 ### 自定义选中状态颜色
```html ```html
<van-dropdown-menu active-color="#ee0a24"> <van-dropdown-menu active-color="#1989fa">
<van-dropdown-item value="{{ value1 }}" options="{{ option1 }}" /> <van-dropdown-item value="{{ value1 }}" options="{{ option1 }}" />
<van-dropdown-item value="{{ value2 }}" options="{{ option2 }}" /> <van-dropdown-item value="{{ value2 }}" options="{{ option2 }}" />
</van-dropdown-menu> </van-dropdown-menu>
@ -133,7 +137,7 @@ Page({
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| active-color | 菜单标题和选项的选中态颜色 | _string_ | `#1989fa` | | active-color | 菜单标题和选项的选中态颜色 | _string_ | `#ee0a24` |
| z-index | 菜单栏 z-index 层级 | _number_ | `10` | | z-index | 菜单栏 z-index 层级 | _number_ | `10` |
| duration | 动画时长,单位毫秒 | _number_ | `200` | | duration | 动画时长,单位毫秒 | _number_ | `200` |
| direction | 菜单展开方向,可选值为 up | _string_ | `down` | | direction | 菜单展开方向,可选值为 up | _string_ | `down` |