From 2af5f043b60c1f7ac38ecccc8f5bf44743134325 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 12 十二月 2025 18:08:00 +0800
Subject: [PATCH] test
---
uni_modules/uni-icons/components/uni-icons/uni-icons.uvue | 158 ++++++++++++++++++++++++++--------------------------
1 files changed, 79 insertions(+), 79 deletions(-)
diff --git a/uni_modules/uni-icons/components/uni-icons/uni-icons.uvue b/uni_modules/uni-icons/components/uni-icons/uni-icons.uvue
index 8740559..53eb2ea 100644
--- a/uni_modules/uni-icons/components/uni-icons/uni-icons.uvue
+++ b/uni_modules/uni-icons/components/uni-icons/uni-icons.uvue
@@ -1,91 +1,91 @@
<template>
- <text class="uni-icons" :style="styleObj">
- <slot>{{unicode}}</slot>
- </text>
+ <text class="uni-icons" :style="styleObj">
+ <slot>{{unicode}}</slot>
+ </text>
</template>
<script>
- import { fontData, IconsDataItem } from './uniicons_file'
+ import { fontData, IconsDataItem } from './uniicons_file'
- /**
- * Icons 鍥炬爣
- * @description 鐢ㄤ簬灞曠ず icon 鍥炬爣
- * @tutorial https://ext.dcloud.net.cn/plugin?id=28
- * @property {Number,String} size 鍥炬爣澶у皬
- * @property {String} type 鍥炬爣鍥炬锛屽弬鑰冪ず渚�- * @property {String} color 鍥炬爣棰滆壊
- * @property {String} customPrefix 鑷畾涔夊浘鏍�- * @event {Function} click 鐐瑰嚮 Icon 瑙﹀彂浜嬩欢
- */
- export default {
- name: "uni-icons",
- props: {
- type: {
- type: String,
- default: ''
- },
- color: {
- type: String,
- default: '#333333'
- },
- size: {
+ /**
+ * Icons 鍥炬爣
+ * @description 鐢ㄤ簬灞曠ず icon 鍥炬爣
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=28
+ * @property {Number} size 鍥炬爣澶у皬
+ * @property {String} type 鍥炬爣鍥炬锛屽弬鑰冪ず渚�+ * @property {String} color 鍥炬爣棰滆壊
+ * @property {String} customPrefix 鑷畾涔夊浘鏍�+ * @event {Function} click 鐐瑰嚮 Icon 瑙﹀彂浜嬩欢
+ */
+ export default {
+ name: "uni-icons",
+ props: {
+ type: {
+ type: String,
+ default: ''
+ },
+ color: {
+ type: String,
+ default: '#333333'
+ },
+ size: {
type: [Number, String],
default: 16
- },
- fontFamily: {
- type: String,
- default: ''
- }
- },
- data() {
- return {};
- },
- computed: {
- unicode() : string {
- let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
- if (codes !== null) {
- return codes.unicode
- }
- return ''
- },
- iconSize() : string {
- const size = this.size
- if (typeof size == 'string') {
- const reg = /^[0-9]*$/g
- return reg.test(size as string) ? '' + size + 'px' : '' + size;
- // return '' + this.size
- }
- return this.getFontSize(size as number)
- },
- styleObj() : UTSJSONObject {
- if (this.fontFamily !== '') {
- return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
- }
- return { color: this.color, fontSize: this.iconSize }
- }
- },
- created() { },
- methods: {
- /**
- * 瀛椾綋澶у皬
- */
- getFontSize(size : number) : string {
- return size + 'px';
- },
- },
- }
+ },
+ fontFamily: {
+ type: String,
+ default: ''
+ }
+ },
+ data() {
+ return {};
+ },
+ computed: {
+ unicode() : string {
+ let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
+ if (codes !== null) {
+ return codes.unicode
+ }
+ return ''
+ },
+ iconSize() : string {
+ const size = this.size
+ if (typeof size == 'string') {
+ const reg = /^[0-9]*$/g
+ return reg.test(size as string) ? '' + size + 'px' : '' + size;
+ // return '' + this.size
+ }
+ return this.getFontSize(size as number)
+ },
+ styleObj() : UTSJSONObject {
+ if (this.fontFamily !== '') {
+ return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
+ }
+ return { color: this.color, fontSize: this.iconSize }
+ }
+ },
+ created() { },
+ methods: {
+ /**
+ * 瀛椾綋澶у皬
+ */
+ getFontSize(size : number) : string {
+ return size + 'px';
+ },
+ },
+ }
</script>
<style scoped>
- @font-face {
- font-family: UniIconsFontFamily;
- src: url('./uniicons.ttf');
- }
+ @font-face {
+ font-family: UniIconsFontFamily;
+ src: url('./uniicons.ttf');
+ }
- .uni-icons {
- font-family: UniIconsFontFamily;
- font-size: 18px;
- font-style: normal;
- color: #333;
- }
+ .uni-icons {
+ font-family: UniIconsFontFamily;
+ font-size: 18px;
+ font-style: normal;
+ color: #333;
+ }
</style>
--
Gitblit v1.9.1