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;

}

}

相关推荐
kyriewen12 分钟前
AI 生成的代码能跑就行?这 5 个坑迟早炸
前端·javascript·ai编程
kisshyshy17 分钟前
🍦 雪糕、食堂、火车厢:三幅漫画吃透栈、队列与链表
javascript·算法
程序猿大帅27 分钟前
别再只当调包侠了:用 Spring AI 落地 Function Calling,我被大模型硬生生砸出了三个大坑
java
谷子在生长29 分钟前
纯血鸿蒙自定义弹窗最佳实践:从「到处复制」到「一行调用」
前端·harmonyos
壹方秘境32 分钟前
我用Go语言开发了一个跨平台的HTTPS抓包和调试工具
前端·后端·ios
神秘面具男32 分钟前
HarmonyOS 6.0跨端远程控制
前端·后端
枫树下x33 分钟前
NestJS基础框架
前端
胡志辉33 分钟前
从v8源码和react深入浅出理解 JavaScript 作用域链与闭包
前端·javascript
天蓝色的鱼鱼1 小时前
React Router v8 来了:react-router-dom 没了,老项目该怎么迁移?
前端·react.js
Bolt1 小时前
TypeScript 7.0 来了:当 tsc 用 Go 重写之后
javascript·typescript·go