From d3e6dd6b3032c119676efa1e9fcee3a8a8043fc5 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期五, 07 三月 2025 13:40:44 +0800
Subject: [PATCH] ‘’
---
src/uni_modules/uview-plus/components/u-icon/u-icon.vue | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/uni_modules/uview-plus/components/u-icon/u-icon.vue b/src/uni_modules/uview-plus/components/u-icon/u-icon.vue
index ce3b52a..0255905 100644
--- a/src/uni_modules/uview-plus/components/u-icon/u-icon.vue
+++ b/src/uni_modules/uview-plus/components/u-icon/u-icon.vue
@@ -81,6 +81,16 @@
*/
export default {
name: 'u-icon',
+ beforeCreate() {
+ // #ifdef APP-NVUE
+ if (this.customFontFamily) {
+ domModule.addRule('fontFace', {
+ 'fontFamily': `${this.customPrefix}-${this.customFontFamily}`,
+ 'src': `url('${this.customFontUrl}')`
+ })
+ }
+ // #endif
+ },
data() {
return {
@@ -136,7 +146,9 @@
// 閫氳繃鍥炬爣鍚嶏紝鏌ユ壘瀵瑰簲鐨勫浘鏍�
icon() {
// 浣跨敤鑷畾涔夊浘鏍囩殑鏃跺�欓〉闈笂浼氭妸name灞炴�т篃灞曠ず鍑烘潵锛屾墍浠ュ湪杩欓噷澶勭悊涓�涓�
- if (this.customPrefix !== "uicon") return "";
+ if (this.customPrefix !== "uicon") {
+ return this.customIcons[this.customPrefix + '-' + this.name] || this.name;
+ }
// 濡傛灉鍐呯疆鐨勫浘鏍囦腑鎵句笉鍒板搴旂殑鍥炬爣锛屽氨鐩存帴杩斿洖name鍊硷紝鍥犱负鐢ㄦ埛鍙兘浼犲叆鐨勬槸unicode浠g爜
return icons['uicon-' + this.name] || this.name
}
@@ -145,7 +157,7 @@
addStyle,
addUnit,
clickHandler(e) {
- this.$emit('click', this.index)
+ this.$emit('click', this.index, e)
// 鏄惁闃绘浜嬩欢鍐掓场
this.stop && this.preventEvent(e)
}
--
Gitblit v1.9.1