在使用ion-slide时报错Uncaught TypeError: Cannot read property 'hasAttribute' of undefined,经检查发现是由于数组数据没有值的原因造成的。
解决方法:
1、为数组数据赋死值。
2、对数组数据的长度进行判断,进而隐藏或显示ion-slide。
ionic3_ion-slide报错Uncaught TypeError: Cannot read property 'hasAttribute' of undefined
最新推荐文章于 2023-03-21 21:52:04 发布
本文详细解析了在使用ion-slide组件时遇到的UncaughtTypeError:Cannotreadproperty'hasAttribute'ofundefined错误原因,并提供了两种有效解决方案:一是直接为数组数据赋初值;二是根据数组数据长度动态控制ion-slide的显示与隐藏。

710





