icon组件
<template>
<i :class="`iconfont icon-${type}`" :style="styles" @click="handleClick"></i>
</template>
<script>
export default {
name: 'Icons',
props: {
type: {
type: String,
default:''
},
color: {
type: String,
default: null
},
size: {
default: 16
}
},
computed: {
styles () {
return {
fontSize: `${this.size}px`,
color: this.color
}
}
},
methods:{
handleClick(e){
this.$emit("on-click",e)
}
}
}
</script>
<style>
</style>