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

UniApp:uni-segmented-control 自定义布局

 自定义tabs选项,items 为tabs名称数组,横向滚动

<scroll-view scroll-x><view class="segmented-control"><view v-for="(item, index) in items" :key="index" class="control-item ":class="{'active': index === activeIndex}" @click="handleActive(index)"><view class="custom-badge flex-end"><view class="custom-badge-info voerflow-text">{{item.info}}</view><view class="custom-badge-txt flex-center">{{ item.name }}</view></view></view></view>
</scroll-view>

样式: 

	.segmented-control {display: flex;// justify-content: space-around;white-space: nowrap;width: 1200rpx;}.control-item {padding: 10px;cursor: pointer;width: 88px;font-family: Source Han Sans SC, Source Han Sans SC;font-weight: 400;font-size: 32rpx;color: #FFFFFF;.custom-badge {width: 100%;.custom-badge-info {position: absolute;background-color: #D54941;padding: 10rpx;font-size: 20rpx;width: 25rpx;border-radius: 100%;margin-top: -35rpx;margin-right: -10rpx;}.custom-badge-txt {width: 100%;font-size: 32rpx;font-weight: 500;}}}.active {color: #007aff;.custom-badge-info {color: #FFFFFF;}}

http://www.lryc.cn/news/507285.html

相关文章:

  • 【算法day17-day18】回溯:解决组合问题
  • 从监控异常发现网络安全
  • Qt之自定义标题栏拓展(十)
  • Verilog中initial的用法
  • (14)D-FINE网络,爆锤yolo系列
  • Python :冬至快乐
  • 重拾设计模式--状态模式
  • 稀疏矩阵的存储与计算 gaxpy
  • 基于LabVIEW的USRP信道测量开发
  • 基于LSTM长短期记忆神经网络的多分类预测【MATLAB】
  • 物联网:全面概述、架构、应用、仿真工具、挑战和未来方向
  • volatility2工具的使用vol2工具篇
  • R 基础运算
  • javaScriptBOM
  • Godot RPG 游戏开发指南
  • 目标检测数据集图片及标签同步旋转角度
  • 2025前端面试热门题目——计算机网络篇
  • LEAST-TO-MOST PROMPTING ENABLES COMPLEX REASONING IN LARGE LANGUAGE MODELS---正文
  • Java开发经验——日志治理经验
  • 使用复数类在C#中轻松绘制曼德布洛集分形
  • VSCode 启用免费 Copilot
  • 常见问题整理
  • 使用Vue创建前后端分离项目的过程(前端部分)
  • 【Springboot知识】Redis基础-springboot集成redis相关配置
  • 网络安全概论——身份认证
  • OpenHarmony-4.HDI 框架
  • leecode494.目标和
  • 在Spring中application 的配置属性(详细)
  • jvm符号引用和直接引用
  • 一文流:JVM精讲(多图提醒⚠️)