123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <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: center;
- flex-wrap: wrap;
- border-right: 1px solid #ccc;
- border-top: 1px solid #ccc;
- box-sizing: border-box;
- margin-top:20upx;
- .item{
- width: 33.33%;
- height: 200upx;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- align-items: center;
- flex-direction: column;
- border-left: 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>
|