2016-09-09 14:29:19 +08:00
|
|
|
<template>
|
|
|
|
<i :class="classes" :style="styles"></i>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
const prefixCls = 'ivu-icon';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
type: String,
|
2016-11-11 18:01:20 +08:00
|
|
|
size: [Number, String],
|
|
|
|
color: String
|
2016-09-09 14:29:19 +08:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
classes () {
|
|
|
|
return `${prefixCls} ${prefixCls}-${this.type}`
|
|
|
|
},
|
|
|
|
styles () {
|
2016-11-11 18:01:20 +08:00
|
|
|
let style = {};
|
|
|
|
|
2016-09-09 14:29:19 +08:00
|
|
|
if (!!this.size) {
|
2016-11-11 18:01:20 +08:00
|
|
|
style['font-size'] = `${this.size}px`;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!!this.color) {
|
|
|
|
style.color = this.color;
|
2016-09-09 14:29:19 +08:00
|
|
|
}
|
2016-11-11 18:01:20 +08:00
|
|
|
|
|
|
|
return style;
|
2016-09-09 14:29:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|