当前位置:网站首页>动态设置小程序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的高度
边栏推荐
- Smooth data migration from single table to sub table
- Towhee 每周模型
- [draw rectangular coordinate system in C language]
- It has been established for 3 years, and now goose factory has an annual income of millions +. As some suggestions of software testing predecessors
- HCIP-第一天
- [enchanting interpretation, 15 minutes let you thoroughly learn how to use the stack!!!]
- 图书馆和档案馆的职能
- 30岁被裁,我想明白的几件事....
- Fist guessing applet based on Object-C novice on the road
- N methods of SQL optimization
猜你喜欢

Multipoint bidirectional republication and routing strategy topology experiment

创业3年,现在鹅厂,年收入百万+,作为软件测试前辈的一些建议....
![[do you know cache - fully understand cache]](/img/65/df29f6f1ff6d0d119da4a3971db0fc.png)
[do you know cache - fully understand cache]

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

C language - assignment operator, compound assignment operator, self increasing and self decreasing operator, comma operator, conditional operator, goto statement, comment

猜拳小程序 基于Object-C 新手上路

面试必问 | 一个线程从创建到消亡要经历哪些阶段?

见证中国网安力量 “解码2022中国网安强星”即将启航

NAT network address translation protocol topology experiment

测试工作十年,想对还在迷茫的朋友说:一点要做好个人规划...
随机推荐
Plato farm is expected to further expand its ecosystem through elephant swap
[C language] relevant distinction between strlen and sizeof
HCIP-第六天-OSPF静态大实验
What is the principle of synchronized lock escalation in multithreading?
PPOCRLabel格式的数据集操作总结。
【在Visual Studio 2019中使用SQLite3库实现学生信息管理系统】
uni-app上自定义微信小程序的tabbar
[draw sherpinski triangle in C language]
【封神演绎、十五分钟让你彻底学会栈的使用!!!】
Solve prime numbers between 100 and 200
Hcip day 6 OSPF static experiment
LeetCode->二分查找打卡(三)
HCIP-第三天-广域网拓扑实验
hcip--ospf接口网络接口类型实验
Hcip OSPF comprehensive experiment
C language - array, string handler, strlen, strcpy and strncpy, strcat and strncat, StrCmp and strncmp
TCP three handshakes and four disconnects
Little sister's notes: how do I learn simple source code to expand my horizons
BigDecimal 的 4 个坑,你踩过几个?
Redis安装及运行(linux)