mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-05 19:41:45 +08:00
docs(Icon): add demo and docs (#2498)
This commit is contained in:
parent
b5ecc922a3
commit
cc48c40547
@ -4,7 +4,8 @@ import Page from '../../common/page';
|
||||
Page({
|
||||
data: {
|
||||
icons,
|
||||
active: 0
|
||||
active: 0,
|
||||
demoIcon: 'location-o'
|
||||
},
|
||||
|
||||
onSwitch(event) {
|
||||
|
@ -48,4 +48,105 @@
|
||||
<view class="text">{{ item }}</view>
|
||||
</van-col>
|
||||
</van-tab>
|
||||
<van-tab title="用法示例" custom-class="demo-tab-pane">
|
||||
<demo-block title="图标右上角小红点">
|
||||
<van-col
|
||||
custom-class="col"
|
||||
span="6"
|
||||
>
|
||||
<van-icon
|
||||
name="{{ demoIcon }}"
|
||||
size="32px"
|
||||
custom-class="icon"
|
||||
/>
|
||||
<view class="text">{{ demoIcon }}</view>
|
||||
</van-col>
|
||||
<van-col
|
||||
custom-class="col"
|
||||
span="6"
|
||||
>
|
||||
<van-icon
|
||||
name="{{ demoIcon }}"
|
||||
size="32px"
|
||||
custom-class="icon"
|
||||
dot
|
||||
/>
|
||||
<view class="text">{{ demoIcon }}</view>
|
||||
</van-col>
|
||||
</demo-block>
|
||||
<demo-block title="图标右上角文字提示">
|
||||
<van-col
|
||||
custom-class="col"
|
||||
span="6"
|
||||
>
|
||||
<van-icon
|
||||
name="{{ demoIcon }}"
|
||||
size="32px"
|
||||
custom-class="icon"
|
||||
/>
|
||||
<view class="text">{{ demoIcon }}</view>
|
||||
</van-col>
|
||||
<van-col
|
||||
custom-class="col"
|
||||
span="6"
|
||||
>
|
||||
<van-icon
|
||||
name="{{ demoIcon }}"
|
||||
size="32px"
|
||||
custom-class="icon"
|
||||
info="99+"
|
||||
/>
|
||||
<view class="text">{{ demoIcon }}</view>
|
||||
</van-col>
|
||||
</demo-block>
|
||||
<demo-block title="图标颜色">
|
||||
<van-col
|
||||
custom-class="col"
|
||||
span="6"
|
||||
>
|
||||
<van-icon
|
||||
name="{{ demoIcon }}"
|
||||
size="32px"
|
||||
custom-class="icon"
|
||||
/>
|
||||
<view class="text">{{ demoIcon }}</view>
|
||||
</van-col>
|
||||
<van-col
|
||||
custom-class="col"
|
||||
span="6"
|
||||
>
|
||||
<van-icon
|
||||
name="{{ demoIcon }}"
|
||||
size="32px"
|
||||
custom-class="icon"
|
||||
color="red"
|
||||
/>
|
||||
<view class="text">{{ demoIcon }}</view>
|
||||
</van-col>
|
||||
</demo-block>
|
||||
<demo-block title="图标大小">
|
||||
<van-col
|
||||
custom-class="col"
|
||||
span="6"
|
||||
>
|
||||
<van-icon
|
||||
name="{{ demoIcon }}"
|
||||
size="32px"
|
||||
custom-class="icon"
|
||||
/>
|
||||
<view class="text">{{ demoIcon }}</view>
|
||||
</van-col>
|
||||
<van-col
|
||||
custom-class="col"
|
||||
span="6"
|
||||
>
|
||||
<van-icon
|
||||
name="{{ demoIcon }}"
|
||||
size="45px"
|
||||
custom-class="icon"
|
||||
/>
|
||||
<view class="text">{{ demoIcon }}</view>
|
||||
</van-col>
|
||||
</demo-block>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
|
@ -35,6 +35,22 @@
|
||||
<van-icon name="chat" info="99+" />
|
||||
```
|
||||
|
||||
### 图标颜色
|
||||
|
||||
设置`color`属性来控制图标颜色
|
||||
|
||||
```html
|
||||
<van-icon name="chat" color="red" />
|
||||
```
|
||||
|
||||
### 图标大小
|
||||
|
||||
设置`size`属性来控制图标大小
|
||||
|
||||
```html
|
||||
<van-icon name="chat" size="50px" />
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### Props
|
||||
|
Loading…
x
Reference in New Issue
Block a user