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