page_callMethod
Call a method on the current page instance with provided arguments and return the result. Use to trigger page logic instead of directly modifying data.
Instructions
调用当前页面实例上暴露的方法(等价 page.callMethod(method, ...args),会 await 结果)。args[] 按位置展开为实参(非命名参数;传一个对象就是第一个位置参数)。返回 {method,arguments,result},result 为方法返回值。何时用:触发页面真实逻辑(优于直接 page_setData 改状态);调组件实例方法用 element_callMethod。方法不存在或内部抛错会以 UserError 返回失败信息。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | ||
| method | Yes | ||
| maxBytes | No | ||
| connection | No | 可选连接覆盖(不传则用默认会话)。可用字段:mode(launch|connect)、cliPath、projectPath、wsEndpoint、timeout、port(【自动化端口】→ cli auto --auto-port,默认 9420;不是 IDE HTTP 服务端口,别把 IDE 服务端口传进来)、account、ticket、trustProject、args、cwd、autoClose、autoLaunch、launchTimeout、connectTimeout。 |