mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
docs(Sidebar): update demo (#1917)
This commit is contained in:
parent
afa3f4a2ad
commit
6a9822115d
@ -1,10 +1,15 @@
|
||||
<demo-block title="基础用法">
|
||||
<view class="container">
|
||||
<van-sidebar bind:change="onChange" custom-class="group">
|
||||
<van-sidebar-item title="标签名称" />
|
||||
<van-sidebar-item title="标签名称" info="8" />
|
||||
<van-sidebar-item title="标签名称" info="99" />
|
||||
<van-sidebar-item title="标签名称" info="99+" />
|
||||
</van-sidebar>
|
||||
</view>
|
||||
<van-sidebar custom-class="custom-sidebar" bind:change="onChange">
|
||||
<van-sidebar-item title="标签名称" />
|
||||
<van-sidebar-item title="标签名称" />
|
||||
<van-sidebar-item title="标签名称" />
|
||||
</van-sidebar>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="显示徽标">
|
||||
<van-sidebar custom-class="custom-sidebar" bind:change="onChange">
|
||||
<van-sidebar-item title="标签名称" info="8" />
|
||||
<van-sidebar-item title="标签名称" info="99" />
|
||||
<van-sidebar-item title="标签名称" info="99+" />
|
||||
</van-sidebar>
|
||||
</demo-block>
|
||||
|
@ -1,10 +1,7 @@
|
||||
.container {
|
||||
width: auto;
|
||||
margin: 0 15px;
|
||||
padding: 20px 0;
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.group {
|
||||
margin: 0 auto;
|
||||
.custom-sidebar {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
@ -20,9 +20,8 @@
|
||||
```html
|
||||
<van-sidebar active="{{ active }}" bind:change="onChange">
|
||||
<van-sidebar-item title="标签名称" />
|
||||
<van-sidebar-item title="标签名称" info="8" />
|
||||
<van-sidebar-item title="标签名称" info="99" />
|
||||
<van-sidebar-item title="标签名称" info="99+" />
|
||||
<van-sidebar-item title="标签名称" />
|
||||
<van-sidebar-item title="标签名称" />
|
||||
</van-sidebar>
|
||||
```
|
||||
|
||||
@ -41,6 +40,18 @@ Page({
|
||||
});
|
||||
```
|
||||
|
||||
### 显示徽标
|
||||
|
||||
通过`info`属性设置徽标内容
|
||||
|
||||
```html
|
||||
<van-sidebar active="{{ active }}">
|
||||
<van-sidebar-item title="标签名称" info="8" />
|
||||
<van-sidebar-item title="标签名称" info="99" />
|
||||
<van-sidebar-item title="标签名称" info="99+" />
|
||||
</van-sidebar>
|
||||
```
|
||||
|
||||
### Sidebar API
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
Loading…
x
Reference in New Issue
Block a user