2024-09-14 02:26:50 +00:00
|
|
|
// @ts-nocheck
|
2025-02-11 01:34:29 +00:00
|
|
|
export function getRect(selector : string, context: ComponentPublicInstance):Promise<NodeInfo> {
|
2024-09-14 02:26:50 +00:00
|
|
|
return new Promise((resolve)=>{
|
|
|
|
uni.createSelectorQuery().in(context).select(selector).boundingClientRect(res =>{
|
|
|
|
resolve(res as NodeInfo)
|
|
|
|
}).exec();
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2025-02-11 01:34:29 +00:00
|
|
|
export function getAllRect(selector : string, context: ComponentPublicInstance):Promise<NodeInfo[]> {
|
2024-09-14 02:26:50 +00:00
|
|
|
return new Promise((resolve)=>{
|
|
|
|
uni.createSelectorQuery().in(context).selectAll(selector).boundingClientRect(res =>{
|
|
|
|
resolve(res as NodeInfo[])
|
|
|
|
}).exec();
|
|
|
|
})
|
|
|
|
}
|