diff --git a/src/pages-quick/components/Tabs/index.vue b/src/pages-quick/components/Tabs/index.vue
index b22325f..be3ec2f 100644
--- a/src/pages-quick/components/Tabs/index.vue
+++ b/src/pages-quick/components/Tabs/index.vue
@@ -1,15 +1,16 @@
-
+
-
+
+ :color="activeIndex === index ? indicatorColor : '#525866'">
{{ zniconsMap[item.icon] }}
+
-
-
-
-
-
diff --git a/src/pages-quick/components/Tabs/styles/index.scss b/src/pages-quick/components/Tabs/styles/index.scss
index 6779ddb..4f8b415 100644
--- a/src/pages-quick/components/Tabs/styles/index.scss
+++ b/src/pages-quick/components/Tabs/styles/index.scss
@@ -1,10 +1,24 @@
.tab-wrapper {
background-color: $theme-color-100;
height: 48px;
+ overflow-x: auto;
+ /* 支持横向滚动 */
+ -webkit-overflow-scrolling: touch;
+ /* 平滑滚动(移动端) */
+ white-space: nowrap;
+ /* 防止换行 */
+ justify-content: flex-start;
+ /* 覆盖工具类,靠左排列以便滚动 */
}
.tab-item {
height: 100%;
+ flex: 0 0 auto;
+ /* 不让子项拉伸,按内容宽度排列 */
+ padding: 0 12px;
+ /* 增加横向间距,便于触控 */
+ min-width: 56px;
+ /* 保证可点击区域 */
}
.icon {
@@ -12,6 +26,13 @@
width: 20px;
}
+/* 组件模板中使用了绝对定位的内部元素,为保证父元素宽度基于内容,重置该子元素为静态布局 */
+.tab-item>.absolute {
+ position: static !important;
+ display: flex;
+ align-items: center;
+}
+
.tab-item-active {
&::before {
content: "";
@@ -33,40 +54,32 @@
z-index: 3;
}
-.tab-indicator {
+/* 已改为每项内部指示器,移除了全局指示器样式 */
+
+/* 每项内的指示器(替代全局指示器) */
+.tab-item-inner {
+ display: inline-flex;
+ align-items: center;
+ position: relative;
+ z-index: 3;
+ /* 确保内容(icon/text)位于 .tab-item-active::before 之上 */
+}
+
+.tab-item-indicator {
+ position: absolute;
bottom: 0;
+ left: 50%;
+ transform: translateX(-50%) scaleX(0.9);
height: 3px;
+ width: 20px;
background-color: $theme-color-500;
border-radius: 4px 4px 0 0;
- transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
- width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- z-index: 3;
- transform: translateZ(0); /* 启用硬件加速 */
- will-change: left, width; /* 优化动画性能 */
-
- /* 初始状态:未初始化时隐藏 */
opacity: 0;
- width: 20px; /* 默认宽度15px */
- left: 0;
+ transition: opacity 0.2s ease, transform 0.2s ease;
+ z-index: 3;
}
-/* 已初始化状态 */
-.tab-indicator.initialized {
+.tab-item-indicator.visible {
opacity: 1;
-}
-
-/* 动画增强 */
-@keyframes tabSwitch {
- 0% {
- transform: translateZ(0) scaleX(0.8);
- opacity: 0.6;
- }
- 100% {
- transform: translateZ(0) scaleX(1);
- opacity: 1;
- }
-}
-
-.tab-indicator.animating {
- animation: tabSwitch 0.3s ease-out;
-}
+ transform: translateX(-50%) scaleX(1);
+}
\ No newline at end of file