<template>
  <i :class="`iconfont icon-${type}`" :style="styles" @click="click"></i>
</template>

<script>
export default {
    name: 'Icons',
    props: {
        type: {
            type: String,
            required: true
        },
        color: {
            type: String,
            default: ''
        },
        size: {
            type: Number,
            default: 16
        }
    },
    computed: {
        styles () {
            let style = {};
            style.fontSize = `${this.size}px`;
            if (this.color) {
                style.color = this.color;
            }
            return style;
        }
    },
    methods:{
        click() {
            this.$emit('click','');
        }
    }
};
</script>

<style>

</style>
