selectorquery selectorquery.in(component component)
基础库 或更高版本; 若版本较低,建议采取 兼容处理 。
将选择器的选取范围更改为自定义组件 component 内
component component
自定义组件实例
object
返回值为 selectorquery 对象实例
selectorquery.in(component component)
component({
querymultiplenodes (){
const query = my.createselectorquery().in(this);
query.select('#the-id').boundingclientrect().exec((rect) => {
console.log('component inner box bounding client rect:', rect);
});
}
})