Icon add color prop

Icon add color prop
This commit is contained in:
梁灏 2016-11-11 18:01:20 +08:00
parent 5709f32ede
commit b79b53ea6f
2 changed files with 14 additions and 8 deletions

View file

@ -7,20 +7,25 @@
export default {
props: {
type: String,
size: [Number, String]
size: [Number, String],
color: String
},
computed: {
classes () {
return `${prefixCls} ${prefixCls}-${this.type}`
},
styles () {
let style = {};
if (!!this.size) {
return {
'font-size': `${this.size}px`
}
} else {
return {}
style['font-size'] = `${this.size}px`;
}
if (!!this.color) {
style.color = this.color;
}
return style;
}
}
}

View file

@ -7,12 +7,13 @@
<!--<Slider :max="10"></Slider>-->
<!--<Slider :step="13"></Slider>-->
<!--<Slider :step="13" :max="60"></Slider>-->
<Icon type="checkmark-circled" size="40" color="#f60"></Icon>
</div>
</template>
<script>
import { Slider } from 'iview';
import { Slider, Icon } from 'iview';
export default {
components: { Slider },
components: { Slider, Icon },
data () {
return {
value: [20, 50]