Touchscreen
Added in: v1.8Touchscreen 类操作在相对于视口左上角的主框架 CSS 像素中。触摸屏上的方法只能在已将 hasTouch 设置为 true 进行初始化的浏览器上下文中使用。
此类仅限于模拟点击手势。有关通过手动触发触摸事件模拟其他手势的示例,请参阅 模拟旧式触摸事件 页面。
方法
touchscreen.tap()
Added in: v1.8 async在位置(x,y)触发一个带有单点触摸的 touchstart 和 touchend 事件。
INFO
如果浏览器上下文的 hasTouch 选项为 false,touchscreen.tap() 将抛出异常。
参数