quickapp_快应用_DOM节点

$element

$element是通用方法(提供给所有组件调用的方法)

获取指定 id 的组件 dom 对象,如果没有指定 id,则返回根组件 dom 对象用法。

this.$element('id名')
获取某元素的宽高
const element =  this.$element('元素id名')
element.getBoundingClientRect({
    
    
   success: data =>{
    
    
     // data中包含元素的宽高 ,left\right\bottom\top
   }
 })

猜你喜欢

转载自blog.csdn.net/qq_43260366/article/details/134801034