
微信小程序切换标签改变样式
发布日期:2021-05-14 12:59:31
浏览次数:15
分类:博客文章
本文共 970 字,大约阅读时间需要 3 分钟。
微信小程序切换标签改变样式
wxml
A B C {{item}}
wxss
.swiper-tab { display: flex; flex-direction: row; line-height: 60rpx; border-bottom: 2rpx solid #777;}.tab-item { width: 33.3%; text-align: center; font-size: 15px; color: rgb(235, 135, 135);}.swiper { width: 100%; font-size: 100rpx; height: 1140rpx; background: #dfdfdf;}.active { color: blue; border-bottom: 5rpx solid blue;}
js
Page({ data: { // tab切换 currentTab: 0, tabs: ["A", "B", "C"], }, swichNav: function (e) { // console.log(e); var that = this; if (this.data.currentTab === e.target.dataset.current) { return false; } else { that.setData({ currentTab: e.target.dataset.current, }); } }, swiperChange: function (e) { // console.log(e); this.setData({ currentTab: e.detail.current, }); },});
The_End
发表评论
最新留言
表示我来过!
[***.240.166.169]2025年04月28日 01时04分17秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
C/C++:线性表之顺序表
2019-03-12
嵌入式系统试题库(CSU)
2019-03-12
图神经网络7日打卡营学习心得
2019-03-12
electronJS 开发linux App
2019-03-12
STM32F7 LWIP协议栈TCP速度测试
2019-03-12
Arm Mbed OS 更适合大学实训平台
2019-03-12
MbedOS 设备中的模数转换(ADC)
2019-03-12
MbedOS+MQTT+TICK 栈构建企业大数据平台
2019-03-12
C++ influxdb 客户端
2019-03-12
关于编程能力的思考
2019-03-12
【vue】setInterval的嵌套实例
2019-03-12
【SpringBoot】如何配置热部署
2019-03-12
【rabbitMQ】04 如何实现高可用?
2019-03-12
机房准备阶段(二)
2019-03-12
【自考】之信息资源管理(一)
2019-03-12
C# 文本框限制大全
2019-03-12
setup facatory9.0打包详细教程(含静默安装和卸载)
2019-03-12
ionic4 路由跳转传值
2019-03-12