<template>
	<view class="icon" :class="['icon-'+type]" :style="{color:color,'font-size':fontSize}" @click="onClick()"></view>
</template>

<script>
	export default {
		name: 'uni-icon',
		props: {
			/**
			 * 图标类型
			 */
			type: String,
			/**
			 * 图标颜色
			 */
			color: String,
			/**
			 * 图标大小
			 */
			size: [Number, String]
		},
		computed: {
			fontSize() {
				return `${this.size}px`
			}
		},
		methods: {
			onClick() {
				this.$emit('click')
			}
		}
	}
</script>

<style>
	@font-face {
		font-family: uniicons;
		font-weight: normal;
		font-style: normal;
		src: url(data:font/truetype;charset=utf-8;base64,[encoded data, 16344 characters]) format('truetype');
	}

	.icon {
		font-family: uniicons;
		font-size: 24px;
		font-weight: normal;
		font-style: normal;
		line-height: 1;
		display: inline-block;
		text-decoration: none;
		-webkit-font-smoothing: antialiased;
	}

	.icon.active {
		color: #007aff;
	}

	.icon-dianhua:before {
	  content: "\e6d0";
	}
	
	.icon-daohang:before {
	  content: "\e6cf";
	}
	
	.icon-zitiyanzheng:before {
	  content: "\e6ae";
	}
	
	.icon-peisong1:before {
	  content: "\e601";
	}
	
	.icon-dingdan:before {
	  content: "\e615";
	}
	
	.icon-ziqu:before {
	  content: "\e698";
	}
	
	.icon-zhunbeizhong:before {
	  content: "\e8b8";
	}
	
	.icon-shoucang1:before {
	  content: "\e6f8";
	}
	
	.icon-shoucang:before {
	  content: "\e600";
	}
	
	.icon-haibao:before {
	  content: "\e61a";
	}
	
	.icon-weixin:before {
	  content: "\e60c";
	}
	
	.icon-fenxiang:before {
	  content: "\e68e";
	}
	
	.icon-huodaofukuan:before {
	  content: "\e64f";
	}
	
	.icon-aiguifanfile:before {
	  content: "\e604";
	}
	
	.icon-jifen:before {
	  content: "\e6a7";
	}
	
	.icon-shouhuodizhi:before {
	  content: "\e629";
	}
	
	.icon-youhui:before {
	  content: "\e654";
	}
	
	.icon-jifen1:before {
	  content: "\e62e";
	}
	
	.icon-bianji:before {
	  content: "\e608";
	}
	
	.icon-logo:before {
	  content: "\e660";
	}
	
	.icon-huiyuanlifttime:before {
	  content: "\e603";
	}
	
	.icon-weixinzhifu:before {
	  content: "\e614";
	}
	
	.icon-yuezhifu:before {
	  content: "\e636";
	}
	
	.icon-mendian:before {
	  content: "\e61c";
	}
	
	.icon-peisong:before {
	  content: "\e64a";
	}
	
	.icon-shanchu:before {
	  content: "\e60a";
	}
	
	.icon-liwu:before {
	  content: "\e605";
	}
	
	.icon-qrcode:before {
	  content: "\e63a";
	}
	
	.icon-close:before {
	  content: "\e607";
	}
	
	.icon-hot:before {
	  content: "\e665";
	}
	
	.icon-jia:before {
	  content: "\e638";
	}
	
	.icon-jian:before {
	  content: "\e631";
	}
	
	.icon-left:before {
	  content: "\e83b";
	}
	
	.icon-right:before {
	  content: "\e83c";
	}
	
	.icon-up:before {
	  content: "\e83d";
	}
	
	.icon-down:before {
	  content: "\e83e";
	}
	
	.icon-daifukuan:before {
	  content: "\e632";
	}
	
	.icon-wanchen:before {
	  content: "\e60b";
	}
	
	.icon-yiguanbi:before {
	  content: "\e63d";
	}
	
	.icon-guanbi:before {
	  content: "\e717";
	}
	
</style>
