Files
lan-manager/web/node_modules/@antv/dom-util/esm/get-style.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

23 lines
630 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 获取样式
* @param {Object} dom DOM节点
* @param {String} name 样式名
* @param {Any} defaultValue 默认值
* @return {String} 属性值
*/
export default function getStyle(dom, name, defaultValue) {
var v;
try {
v = window.getComputedStyle ?
window.getComputedStyle(dom, null)[name] :
dom.style[name]; // 一般不会走到这个逻辑dom.style 获取的是标签 style 属性,也不准确
}
catch (e) {
// do nothing
}
finally {
v = v === undefined ? defaultValue : v;
}
return v;
}
//# sourceMappingURL=get-style.js.map