[Improvement] Icon: support color property (#1031)

This commit is contained in:
刘建东 2018-05-10 16:10:08 +08:00 committed by neverland
parent 7cdd27826a
commit a92fa7d4a8
3 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -51,6 +51,8 @@ import 'vant/lib/vant-css/icon-local.css';
|-----------|-----------|-----------|-------------|
| name | 图标名称 | `String` | `''` |
| info | 图标右上角文字提示 | `String | Number` | `''` |
| color | 图标颜色 | `String` | `''` | - |
### Event

View File

@ -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: {