blockly >实用程序 >样式 >getComputedStyle

utils.style.getComputedStyle() 函数

检索节点的计算样式值。如果请求的属性是 SVG 属性且尚未明确设置(Firefox 和 webkit),则会返回空字符串。

从 Closure 的 goog.style.getComputedStyle 复制

Signature:

export declare function getComputedStyle(element: Element, property: string): string;

参数

参数 类型 说明
元素 元素 要获取样式的元素。
属性 字符串 要获取的属性(驼峰式大小写)。

返回

字符串

样式值。