<template>
	<i :class="['iconfont',cname]" :style="'color:'+color+';font-size:'+fontSize" @tap="$emit('touch')"><slot></slot></i>
</template>

<script>
	export default {
		props: {
			cname: String,
			color: {
				type: String,
				default: '#BDC3C9'
			},
			size: {
				type: [Number, String],
				default: 30
			}
		},
		computed: {
			fontSize() {
				return isNaN(this.size) ? this.size : `${uni.upx2px(this.size)}px`
			}
		}
	}
</script>

<style lang="scss">
	//下载项目文件后直接替换，在iconfont.css字体文件路径前面加上'iconfont/'，并删除font-size: 16px;
	@import "iconfont/iconfont.css"; 
</style>
