未验证 提交 9742012f 编写于 作者: D Drjingfubo 提交者: GitHub

upd(tabbar): 主题定制功能支持 (#420)

* upd: drag,shortpassword

* upd: tabbar,shortpassword,actionsheet

* upd: shortpassword新增方法

* upd: shortpassword按钮颜色抽离

* upd: tabbar的props样式抽离
Co-authored-by: richard_1015's avatarrichard1015 <51844712@qq.com>
上级 0dde4595
...@@ -34,7 +34,7 @@ export default create({ ...@@ -34,7 +34,7 @@ export default create({
}, },
activeColor: { activeColor: {
type: String, type: String,
default: '#fa2c19' default: ''
} }
}, },
emits: ['tab-switch', 'update:show'], emits: ['tab-switch', 'update:show'],
......
.tabbar-item { .nut-tabbar-item {
flex: 1; flex: 1;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
color: $text-color; color: $primary-color;
height: 100%; height: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
}
.icon-box {
padding: 0px;
display: inline-block;
position: relative;
.tips {
position: absolute;
background: $tabbar-active-color;
border: 1px solid $white;
border-radius: 7px;
text-align: center;
top: -2px; &__icon--unactive {
right: -7px; color: $black;
box-shadow: 0 0 0 1px $white;
font-size: $font-size-1;
color: $white;
} }
.num { &_icon-box {
line-height: 1; padding: 0px;
font-size: $font-size-0; display: inline-block;
color: $white; position: relative;
padding: 1px 2px 2px 3px;
}
.nums {
line-height: 1;
font-size: $font-size-0;
color: $white;
padding: 2px 1px 2px 2px;
}
}
.icon-box .icon { &_tips {
display: block; position: absolute;
background-size: 100% 100%; background: $tabbar-active-color;
background-position: center center; border: 1px solid $white;
} border-radius: 7px;
text-align: center;
top: -2px;
right: -7px;
box-shadow: 0 0 0 1px $white;
font-size: $font-size-1;
color: $white;
}
.icon-box .tabbar-nav-word { &_num {
font-size: $font-size-0; line-height: 1;
display: block; font-size: $font-size-0;
} color: $white;
padding: 1px 2px 2px 3px;
}
.icon-box .big-word { &_nums {
font-size: $font-size-large; line-height: 1;
line-height: 1; font-size: $font-size-0;
color: $white;
padding: 2px 1px 2px 2px;
}
&_icon {
display: block;
background-size: 100% 100%;
background-position: center center;
}
&_nav-word {
font-size: $font-size-0;
display: block;
}
&_big-word {
font-size: $font-size-large;
line-height: 1;
}
}
} }
<template> <template>
<div <div
class="tabbar-item" class="nut-tabbar-item"
:class="{ 'nut-tabbar-item__icon--unactive': state.active != state.index }"
:style="{ :style="{
color: color:
state.active == state.index ? state.activeColor : state.unactiveColor state.active == state.index ? state.activeColor : state.unactiveColor
}" }"
@click="change(state.index)" @click="change(state.index)"
> >
<view class="icon-box"> <view class="nut-tabbar-item_icon-box">
<view class="tips num" v-if="num && num <= 99"> <view
class="nut-tabbar-item_icon-box_tips nut-tabbar-item_icon-box_num"
v-if="num && num <= 99"
>
{{ num }} {{ num }}
</view> </view>
<view class="tips nums" v-else-if="num && num > 100">{{ '99+' }}</view> <view
class="nut-tabbar-item_icon-box_tips nut-tabbar-item_icon-box_nums"
v-else-if="num && num > 100"
>{{ '99+' }}</view
>
<view v-if="icon"> <view v-if="icon">
<nut-icon class="icon" :size="state.size" :name="icon"></nut-icon> <nut-icon
class="nut-tabbar-item_icon-box_icon"
:size="state.size"
:name="icon"
></nut-icon>
</view> </view>
<view :class="['tabbar-nav-word', { 'big-word': !icon }]">{{ <view
tabTitle :class="[
}}</view> 'nut-tabbar-item_icon-box_nav-word',
{ 'nut-tabbar-item_icon-box_big-word': !icon }
]"
>{{ tabTitle }}</view
>
</view> </view>
</div> </div>
</template> </template>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册