百度智能小程序 获取页面大小
2020-09-05 15:11 更新
page.size
解释:获取页面大小。
page.size(): Promise<Object>
Object 返回参数说明:
| 参数 | 类型 | 说明 |
|---|---|---|
| width | Number | 页面可滚动宽度 |
| height | Number | 页面可滚动高度 |
示例代码:
automator.launch().then(async smartProgram => {
const page = await smartProgram.currentPage();
const res = await page.size();
console.log(res.width);
console.log(res.height);
})以上内容是否对您有帮助:

免费 AI IDE


更多建议: