uniapp自定义选项卡

<view class="tab-control">

<view class="tab-control-box">

<view class="tab-control-box-top">

<view class="tab-control-item"

v-for="(item, index) in tabData"

:key="item.type"

:class="{'active-tab': index == activeIndex}"

@click="activeIndex = index"

>

{{ item.name }}

</view>

</view>

</view>

</view>

样式

.issue-main {

.tab-control {

background: #FC5041;

padding: 20rpx;

height: 360rpx;

background: linear-gradient(-30deg, transparent 50rpx, #FC5041 0) right,

linear-gradient( 30deg, transparent 50rpx, #FC5041 0) left;

background-size: 50% 100%;

background-repeat: no-repeat;

.tab-control-box {

width: 100%;

height: 420rpx;

background: #FFFFFF;

border-radius: 20rpx 20rpx 20rpx 20rpx;

.tab-control-box-top {

width: 100%;

display: flex;

background: #FD7367;

color: #FFFFFF;

border-radius: 20rpx 20rpx 0rpx 0rpx;

position: relative;

z-index: 1;

.tab-control-item {

width: 25%;

text-align: center;

height: 80rpx;

line-height: 80rpx;

}

}

}

}

}

.active-tab {

background: #fff;

color: #FC5041;

font-weight: bold;

border-radius: 20rpx 20rpx 0rpx 0rpx;

height: 80rpx !important;

line-height: 100rpx !important;

transform: translateY(-10rpx);

&::before {

content: '';

position: absolute;

bottom: -20rpx;

left: 0;

width: 100%;

height: 20rpx;

background: inherit; /* 继承父元素背景 */

z-index: -1;

}

}

相关推荐
砚边数影11 小时前
AI数学基础(一):线性代数核心,向量/矩阵运算的Java实现
java·数据库·人工智能·线性代数·矩阵·ai编程·金仓数据库
欣然~12 小时前
法律案例 PDF 批量转 TXT 工具代码
linux·前端·python
一个小废渣12 小时前
Flutter Web端网络请求跨域错误解决方法
前端·flutter
豆沙沙包?12 小时前
2026年--Lc343-1926. 迷宫中离入口最近的出口(图 - 广度优先搜索)--java版
java·算法·宽度优先
鸣弦artha12 小时前
Flutter框架跨平台鸿蒙开发——Extension扩展方法
android·javascript·flutter
一颗青果12 小时前
auto | 尾置返回类型 | decltype | using | typedef
java·开发语言·算法
符文师13 小时前
css3 新特性
前端·css3
小王不爱笑13213 小时前
SpringBoot 配置文件
java·spring boot·后端
江君是实在人13 小时前
java jvm 调优
java·开发语言·jvm
ct97813 小时前
WebGL开发
前端·gis·webgl