当前位置:网站首页>动态设置小程序swiper的高度
动态设置小程序swiper的高度
2022-07-26 23:18:00 【kilito_01】
根据内容的高度,动态的设置小程序swiper的高度
swiperHeightFn() {
const query = uni.createSelectorQuery().in(this);
//swiperItmeHeight 是swiper-item里包裹内容的类名
query.select('.swiperItmeHeight').boundingClientRect(data => {
this.swiperHeight = data.height
}).exec();
}

这个可以写在一个方法里,这个方法在页面渲染完后设置高度,需要用settimeout包裹,我是在onReady
里调用这个方法去动态的设置swiper的高度
边栏推荐
- 关于序列化变量保存的坑,加了索引器的数据不能序列化
- Interesting C language
- [brother Yang takes you to play with the linear table (I) - sequence table]
- [draw rectangular coordinate system in C language]
- Northeast Securities stock online account, is it safe to open an account on your mobile phone
- [C language programming] branch structure
- 静态路由实验配置
- The latest JD SMS login + silly girl robot nanny level deployment tutorial (July 24, 2022)
- go语言慢速入门——包
- 多线程的具体使用
猜你喜欢

NAT network address translation protocol topology experiment
![[do you know cache - fully understand cache]](/img/65/df29f6f1ff6d0d119da4a3971db0fc.png)
[do you know cache - fully understand cache]

BigDecimal 的 4 个坑,你踩过几个?

Witness that the "decoding 2022 strong star of China's network security" is about to set sail

HCIP-第三天-广域网拓扑实验

The latest multi-threaded & highly concurrent learning materials, interview confidence

Hcip day 6 OSPF static experiment

【洋哥带你玩转线性表(三)——双向链表】

Record the star user of handsomeblog

Sort the three integers from large to small (introduce various methods in detail)
随机推荐
静态路由基本配置 实现全网可达
Talk about the metrics of automated testing
HCIP-第二天
【力扣】1859.将句子排序
图书馆和档案馆的职能
Go language slow start -- go operator
BigDecimal 的 4 个坑,你踩过几个?
Hcip day 4 OSPF routing protocol
Risc-v tool chain compilation notes
【用C语言绘制直角坐标系】
Qt中文乱码常量换行符终极解决方案
多线程的具体使用
小姐姐笔记:我是如何学习简单源码拓展视野的
膜拜,阿里内部都在强推的321页互联网创业核心技术pdf,真的跪了
Greenplum【部署 08】数据库小版本升级流程及问题处理 Error: open-source-greenplum-db-6 conflicts with
It has been established for 3 years, and now goose factory has an annual income of millions +. As some suggestions of software testing predecessors
[brother Yang takes you to play with the linear table (III) - two way linked list]
Fist guessing applet based on Object-C novice on the road
C语言 学生信息管理系统 基于数组 可以存取到文本文件
【自此文之后,学习链表一片坦途】