ElementHandle.isVisible() 方法
¥ElementHandle.isVisible() method
如果以下所有条件都为真,则认为元素是可见的:
¥An element is considered to be visible if all of the following is true:
-
元素具有 计算样式。
¥the element has computed styles.
-
元素具有非空 边界客户端矩形。
¥the element has a non-empty bounding client rect.
-
元素的 visibility 不是
hidden
或collapse
。¥the element's visibility is not
hidden
orcollapse
.
签名
¥Signature
class ElementHandle {
isVisible(): Promise<boolean>;
}
Returns:
Promise<boolean>