mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 17:51:54 +00:00
[Improvement] Icon: support color property (#1031)
This commit is contained in:
@@ -50,6 +50,8 @@ import 'vant/lib/vant-css/icon-local.css';
|
||||
|-----------|-----------|-----------|-------------|
|
||||
| name | Icon name | `String` | `''` |
|
||||
| info | Info message | `String | Number` | `''` |
|
||||
| color | Icon color | `String` | `''` | - |
|
||||
|
||||
|
||||
### Event
|
||||
|
||||
|
@@ -51,6 +51,8 @@ import 'vant/lib/vant-css/icon-local.css';
|
||||
|-----------|-----------|-----------|-------------|
|
||||
| name | 图标名称 | `String` | `''` |
|
||||
| info | 图标右上角文字提示 | `String | Number` | `''` |
|
||||
| color | 图标颜色 | `String` | `''` | - |
|
||||
|
||||
|
||||
### Event
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<i :class="[b(), `van-icon-${name}`]" v-on="$listeners">
|
||||
<i :class="[b(), `van-icon-${name}`]" :style="{ color }" v-on="$listeners">
|
||||
<slot />
|
||||
<div v-if="isDef(info)" :class="b('info')">{{ info }}</div>
|
||||
</i>
|
||||
@@ -14,7 +14,8 @@ export default create({
|
||||
|
||||
props: {
|
||||
name: String,
|
||||
info: [String, Number]
|
||||
info: [String, Number],
|
||||
color: String
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
Reference in New Issue
Block a user