File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -304,12 +304,12 @@ await expect.element(
304304function toBeInViewport(options: { ratio?: number }): Promise<void>
305305` ` `
306306
307- This allows you to check if an element is currently in viewport with [IntersectionObserver API ](https :// developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
307+ 允许你通过 [IntersectionObserver API ](https :// developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) 检查元素是否在当前视口中。
308308
309- You can pass ` ratio ` argument as option , which means the minimal ratio of the element should be in viewport . ` ratio ` should be in 0 ~ 1.
309+ 你可以通过参数 ` ratio ` ,将视口中元素的最小比例设置为 ` ratio ` 。 ` ratio ` 的取值范围为 0 ~ 1 。
310310
311- 该方法通过 IntersectionObserver API 检测元素是否位于当前视口内 。
312- 可通过 ratio 参数指定元素在视口中的最小可见比例 (取值范围为 0 ~ 1 ):
311+ 该方法通过 IntersectionObserver API 检测元素是否位于当前视口内 。
312+ 可通过 ratio 参数指定元素在视口中的最小可见比例 (取值范围为 0 ~ 1 ):
313313` ` ` ts
314314// 检测指定元素是否在视口中
315315await expect.element(page.getByText('Welcome')).toBeInViewport()
You can’t perform that action at this time.
0 commit comments