From dbb43bc57e272d3efe008fb1f056f5e945b470e2 Mon Sep 17 00:00:00 2001 From: ray <1490493387@qq.com> Date: Sat, 4 Oct 2025 16:54:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20:recycle:=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cursor/rules/css-style-guide.mdc | 26 ++++++++- src/pages/mine/index.vue | 91 +++++++++++++++++++++++-------- 2 files changed, 94 insertions(+), 23 deletions(-) diff --git a/.cursor/rules/css-style-guide.mdc b/.cursor/rules/css-style-guide.mdc index bff9f3d..6bd299c 100644 --- a/.cursor/rules/css-style-guide.mdc +++ b/.cursor/rules/css-style-guide.mdc @@ -225,7 +225,31 @@ const iconColor = computed(() => (themeStore.isDark ? "#ffffff" : "#333333")); ❌ **不要使用 `@apply` 指令** ❌ **不要把一次性样式放到全局** ❌ **不要使用非语义化的类名** -❌ **不要在模板中堆叠超过5个原子类** +❌ **不要在模板中堆叠超过5个原子类** +❌ **不要混用UnoCSS原子类和自定义CSS类** - 一个元素应该只使用原子类或只使用自定义类,避免样式管理混乱 + +### 混用问题示例 + +```vue + +内容 +内容 + + +内容 + + +内容 +内容 +``` + +### 解决方案 + +当需要混用时,选择以下方案之一: + +1. **原子类数量≤5个**:移除自定义类,只使用原子类 +2. **原子类数量>5个**:将所有样式合并到自定义类中 +3. **语义明确的区域**:优先使用自定义类,将原子类样式合并进去 ## 组件库样式覆盖 diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue index c5a182f..0d3b48f 100644 --- a/src/pages/mine/index.vue +++ b/src/pages/mine/index.vue @@ -47,22 +47,22 @@ - + - + 0.00 我的余额 - + 0 我的收藏 - + 0 浏览历史 @@ -71,7 +71,7 @@ - +