feat: 初始化
This commit is contained in:
16
uni_modules/lime-shared/getRect/uvue.uts
Normal file
16
uni_modules/lime-shared/getRect/uvue.uts
Normal file
@ -0,0 +1,16 @@
|
||||
// @ts-nocheck
|
||||
export function getRect(selector : string, context: ComponentInternalInstance):Promise<NodeInfo> {
|
||||
return new Promise((resolve)=>{
|
||||
uni.createSelectorQuery().in(context).select(selector).boundingClientRect(res =>{
|
||||
resolve(res as NodeInfo)
|
||||
}).exec();
|
||||
})
|
||||
}
|
||||
|
||||
export function getAllRect(selector : string, context: ComponentInternalInstance):Promise<NodeInfo[]> {
|
||||
return new Promise((resolve)=>{
|
||||
uni.createSelectorQuery().in(context).selectAll(selector).boundingClientRect(res =>{
|
||||
resolve(res as NodeInfo[])
|
||||
}).exec();
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user