mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[breaking change]: Icon: rewrite
This commit is contained in:
parent
b1e37e33da
commit
c059e1ef28
@ -2,7 +2,7 @@
|
|||||||
"navigationBarTitleText": "Icon 图标",
|
"navigationBarTitleText": "Icon 图标",
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"demo-block": "../../components/demo-block/index",
|
"demo-block": "../../components/demo-block/index",
|
||||||
"van-col": "../../dist/icon/index",
|
"van-col": "../../dist/col/index",
|
||||||
"van-icon": "../../dist/icon/index"
|
"van-icon": "../../dist/icon/index"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<demo-block title="图标列表">
|
<demo-block title="图标列表">
|
||||||
<van-col span="8" wx:for="{{ icons }}" wx:key="index">
|
<van-col custom-class="col" span="8" wx:for="{{ icons }}" wx:for-item="icon" wx:key="index">
|
||||||
<van-icon name="{{ item }}" />
|
<van-icon custom-class="icon" name="{{ icon }}" size="32px" />
|
||||||
<view>{{ item }}</view>
|
<view class="text">{{ icon }}</view>
|
||||||
</van-col>
|
</van-col>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
.icon-wrap {
|
.col {
|
||||||
width: 33.33333%;
|
|
||||||
height: 100px;
|
|
||||||
float: left;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
height: 100px;
|
||||||
|
float: none;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.example-icon {
|
.icon {
|
||||||
font-size: 24px;
|
display: block;
|
||||||
padding: 10px;
|
margin: 15px 0;
|
||||||
color: rgba(69, 90, 100, .8);
|
color: rgba(69, 90, 100, .8);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-classname {
|
.text {
|
||||||
color: #999;
|
font-size: 14px;
|
||||||
font-size: 10px;
|
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,8 @@
|
|||||||
|-----------|-----------|-----------|-------------|
|
|-----------|-----------|-----------|-------------|
|
||||||
| name | 图标名称 | `String` | - |
|
| name | 图标名称 | `String` | - |
|
||||||
| info | 图标右上角文字提示 | `String | Number` | - |
|
| info | 图标右上角文字提示 | `String | Number` | - |
|
||||||
| color | 图标颜色 | `String` | - |
|
| color | 图标颜色 | `String` | `inherit` |
|
||||||
|
| size | 图标大小 | `String` | `inherit` |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ Component({
|
|||||||
properties: {
|
properties: {
|
||||||
info: null,
|
info: null,
|
||||||
name: String,
|
name: String,
|
||||||
|
size: String,
|
||||||
color: String
|
color: String
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
<view class="custom-class van-icon van-icon-{{ name }}" style="color: {{ color }}">
|
<view
|
||||||
|
class="custom-class van-icon van-icon-{{ name }}"
|
||||||
|
style="{{ color ? 'color: ' + color : '' }}; {{ size ? 'font-size: ' + size : '' }}"
|
||||||
|
>
|
||||||
<view wx:if="{{ info !== null }}" class="van-icon__info">{{ info }}</view>
|
<view wx:if="{{ info !== null }}" class="van-icon__info">{{ info }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user