ionic怎样获取DOM元素?
来源:
Viola_ma
2016-11-07
let tabbarHeight = (<HTMLElement><any>document.getElementsByTagName('ion-tabbar')[0]).offsetHeight;
console.log("tabbarHeight : " + tabbarHeight);
控制台输出的是:
LabelsSelect ionViewDidLoad error: Cannot read property 'offsetHeight' of undefined。
写回答
1回答
-
Parry
2016-11-07
你 console.log 看看获取到的元素是什么。
00
相似问题