Skip to content
## 页面/区块预览用元数据
Appearance
app-service
传入schema生成代码
基本信息
Path: /api/schema2code
Method: POST
接口描述:
请求参数
Headers
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
|---|---|---|---|---|
| Content-Type | application/json | 是 |
Body
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| framework | string | 非必须 | |||
| pageInfo | object | 非必须 | |||
| ├─ name | string | 非必须 | |||
| ├─ schema | object | 非必须 | |||
| ├─ componentName | string | 非必须 | |||
| ├─ css | string | 非必须 | |||
| ├─ props | object | 非必须 | |||
| ├─ lifeCycles | object | 非必须 | |||
| ├─ children | object [] | 非必须 | item 类型: object | ||
| ├─ componentName | string | 必须 | |||
| ├─ props | object | 必须 | |||
| ├─ text | object | 非必须 | |||
| ├─ key | string | 非必须 | |||
| ├─ type | string | 非必须 | |||
| ├─ en_US | string | 非必须 | |||
| ├─ zh_CN | string | 非必须 | |||
| ├─ className | string | 非必须 | |||
| ├─ onClick | object | 非必须 | |||
| ├─ type | string | 非必须 | |||
| ├─ value | string | 非必须 | |||
| ├─ style | string | 非必须 | |||
| ├─ id | string | 必须 | |||
| ├─ componentType | string | 非必须 | |||
| ├─ dataSource | object | 非必须 | |||
| ├─ list | string [] | 非必须 | item 类型: string | ||
| ├─ | 非必须 | ||||
| ├─ state | object | 非必须 | |||
| ├─ methods | object | 非必须 | |||
| ├─ onClick_new | object | 非必须 | |||
| ├─ type | string | 非必须 | |||
| ├─ value | string | 非必须 | |||
| ├─ utils | string [] | 非必须 | item 类型: string | ||
| ├─ | 非必须 | ||||
| ├─ bridge | string [] | 非必须 | item 类型: string | ||
| ├─ | 非必须 | ||||
| ├─ inputs | string [] | 非必须 | item 类型: string | ||
| ├─ | 非必须 | ||||
| ├─ outputs | string [] | 非必须 | item 类型: string | ||
| ├─ | 非必须 |
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| data | object [] | 非必须 | item 类型: object | ||
| ├─ panelName | string | 非必须 | 文件名称 | ||
| ├─ panelValue | string | 非必须 | 文件内容 | ||
| ├─ panelType | string | 非必须 | 文件类型 | ||
| ├─ prettierOpts | object | 非必须 | 代码格式选项 | ||
| ├─ printWidth | number | 非必须 | 指定每行代码的最大列数 | ||
| ├─ semi | boolean | 非必须 | 控制是否在语句末尾添加分号 | ||
| ├─ singleQuote | boolean | 非必须 | 控制是否使用单引号代替双引号作为字符串的引号样式 | ||
| ├─ trailingComma | string | 非必须 | 控制对象和数组字面量中最后一个属性或元素后面是否添加尾随逗号 | ||
| ├─ parser | string | 非必须 | 指定要使用的解析器 | ||
| ├─ htmlWhitespaceSensitivity | string | 非必须 | 用于控制 HTML 文件中空白字符的敏感度。该选项支持三个值: "css":保留仅对 CSS 属性之前和之后的空白字符进行格式化。 "strict":保留所有空白字符,并尽可能保持原样。 "ignore":忽略所有空白字符,除非它们出现在标签之间。 | ||
| ├─ type | string | 非必须 | 类型 | ||
| ├─ index | boolean | 非必须 | 索引 | ||
| ├─ filePath | string | 非必须 | 文件路径 |
获取页面/区块源码
基本信息
Path: /api/code
Method: GET
接口描述:
请求参数
Query
| 参数名称 | 是否必须 | 示例 | 备注 |
|---|---|---|---|
| type | 是 | Block | Page |
| id | 是 | 123 | 区块或者页面id |
| history | 否 | 123 | 历史记录id |
| framework | 是 | Angular | Vue |
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| data | object [] | 非必须 | item 类型: object | ||
| ├─ panelName | string | 非必须 | 文件名 | ||
| ├─ panelValue | string | 非必须 | 文件内容 | ||
| ├─ panelType | string | 非必须 | 文件类型 | ||
| ├─ prettierOpts | object | 非必须 | 代码样式选项 | ||
| ├─ printWidth | number | 非必须 | 每行长指定每行代码的最大列数度 | ||
| ├─ semi | boolean | 非必须 | 控制是否在语句末尾添加分号 | ||
| ├─ singleQuote | boolean | 非必须 | 控制是否使用单引号代替双引号作为字符串的引号样式 | ||
| ├─ trailingComma | string | 非必须 | 控制对象和数组字面量中最后一个属性或元素后面是否添加尾随逗号 | ||
| ├─ parser | string | 非必须 | 指定要使用的解析器 | ||
| ├─ htmlWhitespaceSensitivity | string | 非必须 | 用于控制 HTML 文件中空白字符的敏感度。该选项支持三个值: "css":保留仅对 CSS 属性之前和之后的空白字符进行格式化。 "strict":保留所有空白字符,并尽可能保持原样。 "ignore":忽略所有空白字符,除非它们出现在标签之间。 | ||
| ├─ type | string | 非必须 | 类型 | ||
| ├─ index | boolean | 非必须 | 索引 | ||
| ├─ filePath | string | 非必须 | 文件路径 |
基本信息
Path: /api/preview/metadata
Method: GET
接口描述:
请求参数
Query
| 参数名称 | 是否必须 | 示例 | 备注 |
|---|---|---|---|
| type | 是 | Page | Page |
| id | 是 | 123 | |
| platform | 是 | 123 | 平台id |
| app | 是 | 123 | 应用id |
| history | 是 | 123 | 历史记录 |
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| data | object | 非必须 | |||
| ├─ assets | object | 非必须 | 资产 | ||
| ├─ material | string [] | 非必须 | 物料 | item 类型: string | |
| ├─ | 非必须 | ||||
| ├─ scripts | string [] | 非必须 | 脚本 | item 类型: string | |
| ├─ | 非必须 | ||||
| ├─ styles | string [] | 非必须 | 样式 | item 类型: string | |
| ├─ | 非必须 | ||||
| ├─ i18n | object [] | 非必须 | 国际化 | item 类型: object | |
| ├─ id | number | 非必须 | |||
| ├─ key | string | 非必须 | |||
| ├─ content | string | 非必须 | 内容 | ||
| ├─ host | number | 非必须 | 关联id:appid或blockid | ||
| ├─ host_type | string | 非必须 | 关联:app或block | ||
| ├─ lang | object | 非必须 | 语言id | ||
| ├─ id | number | 非必须 | |||
| ├─ lang | string | 非必须 | 语言代码 | ||
| ├─ label | string | 非必须 | 语言名称 | ||
| ├─ created_at | string | 非必须 | 创建时间 | ||
| ├─ updated_at | string | 非必须 | 更新时间 | ||
| ├─ created_at | string | 非必须 | |||
| ├─ updated_at | string | 非必须 |