ActionBar
Intro
Used to provide convenient interaction for page-related operations.
Install
Register component globally via app.use, refer to Component Registration for more registration ways.
Usage
Basic Usage
Icon Badge
Use badge prop to show badge in icon.
Custom Icon Color
Custom Button Color
API
ActionBar Props
| Attribute |
Description |
Type |
Default |
| safe-area-inset-bottom |
Whether to enable bottom safe area adaptation |
boolean |
true |
ActionBarIcon Props
| Attribute |
Description |
Type |
Default |
| text |
Button text |
string |
- |
| icon |
Icon |
string |
- |
| color |
Icon color |
string |
#323233 |
| icon-class |
Icon class name |
string | Array | object |
'' |
icon-prefix v3.0.17 |
Icon className prefix |
string |
van-icon |
| dot |
Whether to show red dot |
boolean |
- |
| badge |
Content of the badge |
number | string |
- |
| url |
Link |
string |
- |
| to |
Target route of the link, same as to of vue-router |
string | object |
- |
| replace |
If true, the navigation will not leave a history record |
boolean |
false |
ActionBarButton Props
| Attribute |
Description |
Type |
Default |
| text |
Button text |
string |
- |
| type |
Button type, Can be set to primary info warning danger |
string |
default |
| color |
Button color, support linear-gradient |
string |
- |
| icon |
Left Icon |
string |
- |
| disabled |
Whether to disable button |
boolean |
false |
| loading |
Whether show loading status |
boolean |
false |
| url |
Link |
string |
- |
| to |
Target route of the link, same as to of vue-router |
string | object |
- |
| replace |
If true, the navigation will not leave a history record |
boolean |
false |
ActionBarIcon Slots
| Name |
Description |
| default |
Text |
| icon |
Custom icon |
ActionBarButton Slots
| Name |
Description |
| default |
Button content |
Less Variables
How to use: Custom Theme.
| Name |
Default Value |
Description |
| @action-bar-background-color |
@white |
- |
| @action-bar-height |
50px |
- |
| @action-bar-icon-width |
48px |
- |
| @action-bar-icon-height |
100% |
- |
| @action-bar-icon-color |
@text-color |
- |
| @action-bar-icon-size |
18px |
- |
| @action-bar-icon-font-size |
@font-size-xs |
- |
| @action-bar-icon-active-color |
@active-color |
- |
| @action-bar-icon-text-color |
@gray-7 |
- |
| @action-bar-icon-background-color |
@white |
- |
| @action-bar-button-height |
40px |
- |
| @action-bar-button-warning-color |
@gradient-orange |
- |
| @action-bar-button-danger-color |
@gradient-red |
- |