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;

}

}

相关推荐
han_hanker2 分钟前
@Validated @Valid 用法
java·spring boot
嗷o嗷o2 分钟前
Android App Functions 深入理解
前端
小CC吃豆子4 分钟前
详细介绍一下静态分析工具 SonarQube
java
qq_20815408856 分钟前
瑞树6代流程分析
javascript·python
DevOpenClub7 分钟前
全国三甲医院主体信息 API 接口
java·大数据·数据库
UXbot9 分钟前
AI原型设计工具评测:从创意到交互式Demo,5款产品全面解析
前端·ui·设计模式·ai·ai编程·原型模式
落魄江湖行10 分钟前
硅基同事埋的坑,我用2小时才填平:Nuxt 4 路由踩坑:可选参数 [[id]] 与 [id] 的区别
前端
言慢行善14 分钟前
SpringBoot中的注解介绍
java·spring boot·后端
一勺菠萝丶17 分钟前
管理后台使用手册在线预览与首次登录引导弹窗实现
java·前端·数据库
军军君0117 分钟前
Three.js基础功能学习十四:智能黑板实现实例一
前端·javascript·css·typescript·前端框架·threejs·智能黑板