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

uniapp轮播 轮播图内有定位样式

自己收藏的
轮播图内有定位样式 轮播小点自定义样式。实现轮播。


<template><view class="container"><swiper class="swiper" :autoplay="true" :interval="3000" :duration="500"indicator-dotscircular><!-- 第一个轮播项:底图+相对定位图片 --><swiper-item><view class="slide-container"><!-- 底图 --><image class="base-image" src="https://kdwl-cw.oss-cn-beijing.aliyuncs.com/static/img/report_car.png" mode="aspectFill"></image><!-- 相对定位的图片 --><image class="overlay-image" src="https://kdwl-cw.oss-cn-beijing.aliyuncs.com/static/img/icon_1.png" mode="aspectFit"></image></view></swiper-item><!-- 第二个轮播项:底图+相对定位文字 --><swiper-item><view class="slide-container"><!-- 底图 --><image class="base-image" src="https://kdwl-cw.oss-cn-beijing.aliyuncs.com/static/img/report_car.png" mode="aspectFill"></image><!-- 相对定位的文字 --><view class="text-overlay"><text class="title">轮播图标题</text><text class="subtitle">这里是轮播图的描述文字内容</text></view></view></swiper-item></swiper></view>
</template><script>
export default {data() {return {}}
}
</script><style>
.container {width: 100%;height: 100%;
}.swiper {width: 100%;height: 640rpx;
}
/* 默认指示点的样式 */.swiper .wx-swiper-dot {width: 8rpx;height: 6rpx;background: #D8D8D8;border-radius: 3rpx;}/* 选中指示点的样式 */.swiper .wx-swiper-dot.wx-swiper-dot-active {width: 21rpx;height: 6rpx;background: #4172F0;border-radius: 3rpx;}.slide-container {width: 100%;height: 100%;position: relative;
}.base-image {width: 100%;height: 100%;
}.overlay-image {position: absolute;width: 200rpx;height: 200rpx;top: 50%;left: 50%;transform: translate(-50%, -50%);
}.text-overlay {position: absolute;bottom: 40rpx;left: 30rpx;color: #fff;text-shadow: 0 2rpx 4rpx rgba(0,0,0,0.5);
}.title {font-size: 36rpx;font-weight: bold;display: block;margin-bottom: 10rpx;
}.subtitle {font-size: 24rpx;display: block;
}
</style>
http://www.dtcms.com/a/343705.html

相关文章:

  • uniappx鸿蒙适配
  • 2025年视频大模型汇总、各自优势及视频大模型竞争焦点
  • 2025年5月架构设计师综合知识真题回顾,附参考答案、解析及所涉知识点(七)
  • 蓝牙学习--连接蓝牙播放音乐无声的分析步骤
  • Matplotlib 可视化大师系列(六):plt.imshow() - 绘制矩阵与图像的强大工具
  • 【大语言模型 13】Dropout与正则化技术全景:深度网络过拟合防御的终极武器
  • 什么是短视频矩阵系统企业立项功能源码开发,支持OEM
  • Flask 之 Cookie Session 详解:用户状态管理
  • 了解 PostgreSQL 的 MVCC 可见性基本检查规则
  • Apache Flink集群架构:核心角色与协同机制
  • 【ElasticSearch】使用docker compose,通过编写yml安装es8.15和kibana可视化界面操作,go连接es
  • 为什么需要关注Flink并行度?
  • 使用 Apache Flink CDC 3.0 实现 MySQL 到 Elasticsearch 的数据同步
  • 回归测试的重要性与实践指南
  • 十年磨一剑!Apache Hive 性能优化演进全史(2013 - )
  • Ubuntu部署K8S集群
  • unistd.h 常用函数速查表
  • 论文精读(三)|智能合约漏洞检测技术综述
  • 《WINDOWS 环境下32位汇编语言程序设计》第7章 图形操作(1)
  • Redis内存架构解析与性能优化实战
  • 通用的嵌入式 Linux 系统镜像制作流程
  • STM32F103RC的USB上拉电阻1.5K
  • MongoDB 从入门到实践:全面掌握文档型 NoSQL 数据库核心操作
  • 基于Node.js服务端的社区报修管理系统/基于express的在线报修管理系统
  • (论文速读)RandAR:突破传统限制的随机顺序图像自回归生成模型
  • 基于C#的宠物医院管理系统/基于asp.net的宠物医院管理系统
  • 开源 python 应用 开发(十)音频压缩
  • AI时代的“双刃剑”:效率革命与人文焦虑的碰撞
  • week3-[二维数组]小方块
  • 靶机 - SAR