uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改
This commit is contained in:
18
uni_modules/lime-shared/dom/index.ts
Normal file
18
uni_modules/lime-shared/dom/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// @ts-nocheck
|
||||
export function findClosestElementWithStyle(startEl: UniElement | null, styleProperty: string): UniElement | null {
|
||||
let currentEl: UniElement | null = startEl;
|
||||
|
||||
while (currentEl != null) {
|
||||
// Check if the current element has the style property with a non-empty value
|
||||
const styleValue = currentEl?.style.getPropertyValue(styleProperty) ?? '';
|
||||
if (styleValue.trim() != '') {
|
||||
return currentEl;
|
||||
}
|
||||
|
||||
// Move to parent element
|
||||
currentEl = currentEl.parentElement;
|
||||
}
|
||||
|
||||
// Return null if no element with the specified style was found
|
||||
return null;
|
||||
};
|
||||
Reference in New Issue
Block a user