blockly > utils > style > getComputedStyle

utils.style.getComputedStyle() 函数

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

从 Closure 的 goog.style.getComputedStyle 中复制

Signature:

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

参数

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

返回

string

样式值。