element_getWxml
Retrieve the WXML structure of a UI element in a WeChat Mini Program. Use selector to target elements, optionally include outer WXML or inner elements of custom components.
Instructions
获取元素 WXML。默认 element.wxml() 返回内部 WXML;outer=true 返回含元素自身的 outerWxml。要读自定义组件内部的 WXML,用 selector 定位组件、innerSelector 定位内部元素。结果超过 maxBytes(默认 50000B)返回 {truncated,bytes,maxBytes,note,data} 包装(WXML 最容易撑爆);截断时改用更具体的 selector 或调大 maxBytes。selector 支持 [index=N](仅作用于 selector)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| outer | No | ||
| maxBytes | No | ||
| selector | Yes | ||
| 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。 | |
| innerSelector | No |