mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
parent
1ad701db23
commit
2c8a619e76
@ -17,10 +17,10 @@
|
||||
|
||||
### 基础用法
|
||||
|
||||
通过在`van-sidebar`上设置`active`属性来控制选中项
|
||||
通过在`van-sidebar`上设置`activeKey`属性来控制选中项
|
||||
|
||||
```html
|
||||
<van-sidebar active="{{ active }}" bind:change="onChange">
|
||||
<van-sidebar active-key="{{ activeKey }}" bind:change="onChange">
|
||||
<van-sidebar-item title="标签名称" />
|
||||
<van-sidebar-item title="标签名称" />
|
||||
<van-sidebar-item title="标签名称" />
|
||||
@ -30,7 +30,7 @@
|
||||
``` javascript
|
||||
Page({
|
||||
data: {
|
||||
active: 0
|
||||
activeKey: 0
|
||||
},
|
||||
|
||||
onChange(event) {
|
||||
@ -47,7 +47,7 @@ Page({
|
||||
设置`dot`属性后,会在右上角展示一个小红点。设置`info`属性后,会在右上角展示相应的徽标
|
||||
|
||||
```html
|
||||
<van-sidebar active="{{ active }}">
|
||||
<van-sidebar active-key="{{ activeKey }}">
|
||||
<van-sidebar-item title="标签名称" dot />
|
||||
<van-sidebar-item title="标签名称" info="5" />
|
||||
<van-sidebar-item title="标签名称" info="99+" />
|
||||
@ -60,7 +60,7 @@ Page({
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||
|-----------|-----------|-----------|-------------|-------------|
|
||||
| active | 选中项的索引 | *string \| number* | `0` | - |
|
||||
| activeKey | 选中项的索引 | *string \| number* | `0` | - |
|
||||
|
||||
### Sidebar Event
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user