feat: 主题颜色的调整,现在支持切换颜色
This commit is contained in:
@@ -1,30 +1,19 @@
|
||||
<template>
|
||||
<view class="tab-container relative">
|
||||
<view class="tab-wrapper flex flex-items-center flex-justify-center">
|
||||
<view
|
||||
v-for="(item, index) in tabList"
|
||||
:key="index"
|
||||
:class="[
|
||||
'tab-item flex flex-full flex-items-center flex-justify-center relative',
|
||||
activeIndex === index && 'tab-item-active',
|
||||
]"
|
||||
@click="handleTabClick(index)"
|
||||
>
|
||||
<view v-for="(item, index) in tabList" :key="index" :class="[
|
||||
'tab-item flex flex-full flex-items-center flex-justify-center relative',
|
||||
activeIndex === index && 'tab-item-active',
|
||||
]" @click="handleTabClick(index)">
|
||||
<view class="absolute flex flex-items-center">
|
||||
<uni-icons
|
||||
class="icon mr-4"
|
||||
fontFamily="znicons"
|
||||
size="20"
|
||||
:color="activeIndex === index ? '#2D91FF' : '#525866'"
|
||||
>
|
||||
<uni-icons class="icon mr-4" fontFamily="znicons" size="20"
|
||||
:color="activeIndex === index ? '$theme-color-500' : '#525866'">
|
||||
{{ zniconsMap[item.icon] }}
|
||||
</uni-icons>
|
||||
<text
|
||||
:class="[
|
||||
'font-size-16 font-500 color-525866 ',
|
||||
activeIndex === index && 'tab-text-active',
|
||||
]"
|
||||
>
|
||||
<text :class="[
|
||||
'font-size-16 font-500 color-525866 ',
|
||||
activeIndex === index && 'tab-text-active',
|
||||
]">
|
||||
{{ item.label }}
|
||||
</text>
|
||||
</view>
|
||||
@@ -32,17 +21,14 @@
|
||||
</view>
|
||||
|
||||
<!-- 下划线指示器 -->
|
||||
<view
|
||||
:class="[
|
||||
'tab-indicator absolute',
|
||||
indicatorAnimating && 'animating',
|
||||
indicatorInitialized && 'initialized',
|
||||
]"
|
||||
:style="{
|
||||
left: indicatorLeft + 'px',
|
||||
width: indicatorWidth + 'px',
|
||||
}"
|
||||
></view>
|
||||
<view :class="[
|
||||
'tab-indicator absolute',
|
||||
indicatorAnimating && 'animating',
|
||||
indicatorInitialized && 'initialized',
|
||||
]" :style="{
|
||||
left: indicatorLeft + 'px',
|
||||
width: indicatorWidth + 'px',
|
||||
}"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user