docs(Sidebar): rename prop active to activeKey (#2470)

fix #2444
This commit is contained in:
rex 2019-12-05 10:11:38 +08:00 committed by GitHub
parent 1ad701db23
commit 2c8a619e76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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