当前位置: 首页 > news >正文

记录一下tab梯形圆角的开发解决方案

实现这种样式:

直接写代码,具体原理可参考作者的博客:
https://juejin.cn/post/7230737419842633788

<div class="tabContent"><div:class="['tab-item',current === index ? 'tab-selected' : 'not-selected',]"v-for="(item, index) in list":key="item.name"@click="selectTab(index)">{{ item.name }}</div>
</div>current: 0,
list: [{name: "积分明细",},{name: "积分获取",},{name: "积分使用",},
],.tabContent {display: flex;position: relative;z-index: 2;border-radius: 12px 12px 0 0;background-color: #6bb93e;overflow: hidden; // 重点.tab-item {flex: 1;height: 90upx;display: flex;justify-content: center;align-items: center;font-size: 28upx;// opacity: 0.65;   // 暂时删除,不选中样式需要重新编写color: #fff;font-weight: 600;position: relative;}.tab-selected {opacity: 1;background: #ffffff;color: black;border-radius: 12px 12px 0 0;box-shadow: 24px 33px 0 #fff, -24px 33px 0 0 #fff; // 重点}.tab-selected::before {content: "";position: absolute;left: -6px;bottom: 0;width: 12px;height: 90upx;border-top-left-radius: 12px;background-color: #fff;transform: skewX(-15deg); // 重点}.tab-selected::after {content: "";position: absolute;right: -6px;bottom: 0;width: 12px;height: 90upx;border-top-right-radius: 12px;background-color: #fff;transform: skewX(15deg); // 重点}.not-selected::before {content: "";position: absolute;left: 6px;bottom: 0;width: 12px;height: 52px;background: #6bb93e;border-bottom-left-radius: 12px;transform: skewX(15deg); // 重点}.not-selected::after {content: "";position: absolute;right: 6px;bottom: 0;width: 12px;height: 52px;background: #6bb93e;border-bottom-right-radius: 12px;transform: skewX(-15deg); // 重点z-index: 1;}}

http://www.dtcms.com/a/367277.html

相关文章:

  • java面试中经常会问到的dubbo问题有哪些(基础版)
  • illustrator-04
  • 观察者模式-红绿灯案例
  • 【LLM】FastMCP v2 :让模型交互更智能
  • Linux下开源邮件系统Postfix+Extmail+Extman环境部署记录
  • 在Anaconda下安装GPU版本的Pytorch的超详细步骤
  • 追觅科技举办2025「敢梦敢为」发布会,发布超30款全场景重磅新品
  • 从“AI炼金术”到“研发加速器”:一个研发团队的趟坑与重生实录
  • B站 XMCVE Pwn入门课程学习笔记(9)
  • 【数学建模学习笔记】机器学习回归:XGBoost回归
  • 本地部署开源数据生成器项目实战指南
  • Agentic AI 架构全解析:到底什么是Agentic AI?它是如何工作的
  • AI助力软件UI概念设计:卓伊凡收到的客户设计图引发的思考
  • 零样本学习与少样本学习
  • QT6(事件与信号及事件过滤器)
  • JavaAI炫技赛:电商系统商品管理模块的创新设计与实践探索
  • 移动端WebView调试 iOS App网络抓包与请求分析工具对比
  • 给文件加密?企业文件加密软件有哪些?
  • 【C语言】第二课 位运算
  • 【正则表达式】 正则表达式匹配位置规则是怎么样的?
  • 【LeetCode数据结构】设计循环队列
  • Python 第三方自定义库开发与使用教程
  • Browser Use 浏览器自动化 Agent:让浏览器自动为你工作
  • AI代码管家:告别烂代码的自动化魔法
  • 数据结构_二叉平衡树
  • 君正交叉编译链工具mips-gcc540-glibc222-64bit-r3.3.0.smaller.bz2编译st-device-sdk-c
  • Stylar AI: 基于AI的平面设计工具
  • echarts图库
  • 软考中级【网络工程师】第6版教材 第5章 网络互连(1)
  • 片上网络Noc原理