From 8c047f7da19d7e59136a322e1a851d4b6b0eab97 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期四, 06 三月 2025 17:30:31 +0800
Subject: [PATCH] -

---
 src/uni_modules/uview-plus/components/u-grid-item/u-grid-item.vue |   27 +++++++--------------------
 1 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/src/uni_modules/uview-plus/components/u-grid-item/u-grid-item.vue b/src/uni_modules/uview-plus/components/u-grid-item/u-grid-item.vue
index 867e897..43c5ce7 100644
--- a/src/uni_modules/uview-plus/components/u-grid-item/u-grid-item.vue
+++ b/src/uni_modules/uview-plus/components/u-grid-item/u-grid-item.vue
@@ -52,9 +52,6 @@
 				// #ifdef APP-NVUE
 				width: 0, // nvue涓嬫墠杩欎箞璁$畻锛寁ue涓嬫斁鍒癱omputed涓紝鍚﹀垯浼氬洜涓哄欢鏃堕�犳垚闂儊
 				// #endif
-				// #ifdef MP-TOUTIAO
-				width: '100%',
-				// #endif
 				classes: [], // 绫诲悕闆嗗悎锛岀敤浜庡垽鏂槸鍚︽樉绀哄彸杈瑰拰涓嬭竟妗�
 			};
 		},
@@ -69,26 +66,16 @@
 		},
 		// #endif
 		computed: {
-			// #ifndef APP-NVUE || MP-TOUTIAO
-			// vue涓嬫斁鍒癱omputed涓紝鍚﹀垯浼氬洜涓哄欢鏃堕�犳垚闂儊
-			width() {
-				if (this.parentData.col > 0) {
-					return 100 / Number(this.parentData.col) + '%'
-				} else {
-					return 0;
-				}
-			},
-			// #endif
 			itemStyle() {
 				const style = {
-					background: this.bgColor,
-					// #ifndef MP
-					width: this.width
-					// #endif
-					// #ifdef MP
-					width: '100%'
-					// #endif
+					background: this.bgColor
 				}
+				// #ifdef APP-NVUE
+				style['width'] = this.width
+				// #endif
+				// #ifndef APP-NVUE
+				style['width'] = '100%'
+				// #endif
 				return deepMerge(style, addStyle(this.customStyle))
 			}
 		},

--
Gitblit v1.9.1