element_getWxml
Extract WXML code from WeChat Mini Program elements to inspect component structure, supporting both inner content and outer markup retrieval for development analysis.
Instructions
获取元素 WXML。默认获取内部 WXML(element.wxml()),设置 outer 为 true 可获取包含元素本身的 WXML(element.outerWxml())。如需获取自定义组件内部元素的 WXML,请使用 innerSelector 参数:selector 设为组件 ID 选择器(如 #my-component),innerSelector 设为组件内部元素的选择器。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No | ||
| selector | Yes | ||
| innerSelector | No | ||
| outer | No |
Input Schema (JSON Schema)
{
"properties": {
"connection": {
"additionalProperties": false,
"properties": {
"account": {
"minLength": 1,
"type": "string"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
},
{
"not": {}
}
]
},
"autoClose": {
"type": "boolean"
},
"cliPath": {
"minLength": 1,
"type": "string"
},
"cwd": {
"minLength": 1,
"type": "string"
},
"mode": {
"enum": [
"launch",
"connect"
],
"type": "string"
},
"port": {
"exclusiveMinimum": 0,
"type": "integer"
},
"projectPath": {
"minLength": 1,
"type": "string"
},
"ticket": {
"minLength": 1,
"type": "string"
},
"timeout": {
"exclusiveMinimum": 0,
"type": "integer"
},
"trustProject": {
"type": "boolean"
},
"wsEndpoint": {
"minLength": 1,
"type": "string"
}
},
"type": "object"
},
"innerSelector": {
"minLength": 1,
"type": "string"
},
"outer": {
"default": false,
"type": "boolean"
},
"selector": {
"minLength": 1,
"type": "string"
}
},
"required": [
"selector"
],
"type": "object"
}