当前位置:网站首页>轮播图van-swipe的报错:cannot read a properties of null(reading width)
轮播图van-swipe的报错:cannot read a properties of null(reading width)
2022-07-24 03:08:00 【五颜六色的黑】

在使用vant做移动端项目的时候呢,使用轮播图插件的时候,在data中模拟数据就会抛出如上错误:
官网给出的解决方案:
1.使用v-if代替v-show,用v-if来判断加载
2、使用延时重新渲染的方式。
watch: {
list(val) {
var _this = this;
setTimeout(() => {
_this.$refs.swipe.resize();
}, 500);
},
},
试了两个方案:如果把数据直接定死在data中,都不起作用
除非在data中声明渲染的轮播列表为空,在数据请求过来的的时候再赋值就可以,没啥问题
边栏推荐
- A simple and perfect WPF management system framework source code
- 攻防世界WEB練習區(view_source、get_post、robots)
- Hospital PACS source code PACS ultrasonic Department source code DICOM image workstation source code [source code free sharing]
- Summernote supports custom video upload function
- PMP first-hand data and information acquisition
- TCP data transmission and performance
- Lumberyard game engine of o3de
- Some properties of differential array operation
- How to realize software function safety
- kettle
猜你喜欢

Basic use of Pinia

Soft test --- fundamentals of programming language (Part 1)

Attack and defense world web practice area (webshell, command_execution, simple_js)

MySQL sub database and sub table and its smooth expansion scheme

CMT 注册——Google Scholar Id,Semantic Scholar Id,和 DBLP Id

The function of SIP account - tell you what is SIP line
[email protected] Principle of use"/>(6) Decorator extension [email protected] Principle of use

SSM's technical forum includes front and back offices

老公,我们现在无家可归了

String.split()最详细源码解读及注意事项
随机推荐
老公,我们现在无家可归了
Binary tree traversal (day 74)
How to realize software function safety
Microsoft win11/10 package manager Winget will support the installation of applications from zip files
Binary tree traversal
Unity 消息推送
SolidWorks cannot reference references
kettle
Zone d'entraînement Web d'attaque et de défense (View source, get Post, robots)
The simple use of ADB command combined with monkey is super detailed
Is it safe to open an account for Xiaobai stock? Can I apply online?
在openEuler社区开源的Embedded SIG,来聊聊它的多 OS 混合部署框架
[hdlbits questions] Verilog language (2) vectors
summernote支持自定义视频上传功能
JVM初始
Ways to improve the utilization of openeuler resources 01: Introduction
The function of SIP account - tell you what is SIP line
The implementation in unity determines whether missing or null
Symbol類型
198. House raiding