mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[improvement] Icon: add class-prefix prop (#475)
This commit is contained in:
parent
e11bc516a2
commit
d06a350053
3
dist/icon/index.js
vendored
3
dist/icon/index.js
vendored
@ -9,7 +9,8 @@ Component({
|
||||
info: null,
|
||||
name: String,
|
||||
size: String,
|
||||
color: String
|
||||
color: String,
|
||||
classPrefix: String
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
2
dist/icon/index.wxml
vendored
2
dist/icon/index.wxml
vendored
@ -1,5 +1,5 @@
|
||||
<view
|
||||
class="custom-class van-icon van-icon-{{ name }}"
|
||||
class="custom-class {{ classPrefix }} {{ classPrefix }}-{{ name }}"
|
||||
style="{{ color ? 'color: ' + color : '' }}; {{ size ? 'font-size: ' + size : '' }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
|
@ -27,6 +27,7 @@
|
||||
| info | 图标右上角文字提示 | `String | Number` | - |
|
||||
| color | 图标颜色 | `String` | `inherit` |
|
||||
| size | 图标大小 | `String` | `inherit` |
|
||||
| class-prefix | 类名前缀 | `String` | `van-icon` |
|
||||
|
||||
### Event
|
||||
|
||||
|
@ -9,7 +9,11 @@ Component({
|
||||
info: null,
|
||||
name: String,
|
||||
size: String,
|
||||
color: String
|
||||
color: String,
|
||||
classPrefix: {
|
||||
type: String,
|
||||
value: 'van-icon'
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<view
|
||||
class="custom-class van-icon van-icon-{{ name }}"
|
||||
class="custom-class {{ classPrefix }} {{ classPrefix }}-{{ name }}"
|
||||
style="{{ color ? 'color: ' + color : '' }}; {{ size ? 'font-size: ' + size : '' }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
|
Loading…
x
Reference in New Issue
Block a user