<template>
	<view class="content">
		<view class="icon-wrap" >
			<view class="item"  v-for="(item,index) in items" :key="index" @click="check(item)">
				<text class="zhcx-iconfont" :class="item"></text>
				<text class="name">{{item}}</text>
			</view>			
		</view>
	</view>
</template>

<script>
	import items from './data.js';
	export default{
		name:'zhcx-icon',
		data(){
			return{
				items,
				iconTxt:"",
				star:3.6
			}
		},
		methods:{
			check(value){
				uni.showModal({
					title:"温馨提示！",
					content:"复制图标的类名",
					confirmText:'直接复制',
					cancelColor:"orange",
					cancelText:"去看源码",
					success:()=>{
					  uni.setClipboardData({
						data:value,
						success:()=>{
						  uni.showToast({
							title:'复制成功'
						  })
						}
					  });
					},
					fail(res){
						uni.showToast({
						  title:'复制失败'
						})						
					}
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		padding-bottom: 20upx;
		padding-top: 30upx;
		.icon-wrap{
			width: 100%;
			display: flex;
			justify-content: flex-start;
			flex-wrap: wrap;
			border-left: 1px solid #ccc;
			border-top: 1px solid #ccc;
			box-sizing: border-box;
			margin:20upx 0 100upx 0;
			.item{
				width: 33.33%;
				height: 200upx;
				box-sizing: border-box;
				display: flex;
				justify-content: space-between;
				align-items: center;
				flex-direction: column;
				border-right: 1px solid #ccc;
				border-bottom: 1px solid #ccc;
				.zhcx-iconfont{
					font-size: 65upx;
					text-align: center;
					margin-top: 50upx;
					color: #666;
				}
				.name{
					width: 80%;
					font-size: 24upx;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
					padding-bottom: 15upx;
					text-align: center;
				}
			}			
		}
	}
</style>
