2020-05-27 14:57:40 +08:00
|
|
|
|
{
|
2020-09-03 11:45:31 +08:00
|
|
|
|
"$id": "/schemas/drawer.json#",
|
2020-08-21 15:28:22 +08:00
|
|
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
2020-09-03 11:45:31 +08:00
|
|
|
|
"$ref": "/schemas/drawer.json#/definitions/common"
|
2020-08-21 15:28:22 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"additionalProperties": false,
|
|
|
|
|
"dependencies": {},
|
|
|
|
|
"patternProperties": {
|
|
|
|
|
"^(className|initApi|initFetch|name|bodyClassName|title|body|size|actions|colseOnEsc|messages)$": {}
|
|
|
|
|
},
|
|
|
|
|
"properties": {
|
|
|
|
|
"$schema": {
|
|
|
|
|
"format": "uri",
|
|
|
|
|
"type": "string",
|
|
|
|
|
"description": "绑定 JSON 格式说明,可忽略!"
|
2020-05-27 14:57:40 +08:00
|
|
|
|
},
|
2020-08-21 15:28:22 +08:00
|
|
|
|
"type": {
|
|
|
|
|
"const": "drawer",
|
|
|
|
|
"description": "指定为 drawer 弹框渲染器",
|
|
|
|
|
"type": "string"
|
2020-05-27 14:57:40 +08:00
|
|
|
|
}
|
2020-08-21 15:28:22 +08:00
|
|
|
|
},
|
|
|
|
|
"required": ["type"]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"definitions": {
|
|
|
|
|
"common": {
|
|
|
|
|
"description": "amis drawer 渲染器,格式说明。https://baidu.github.io/amis/docs/renderers#drawer",
|
|
|
|
|
"properties": {
|
|
|
|
|
"actions": {
|
|
|
|
|
"description": "默认不用填写,自动会创建确认和取消按钮。",
|
|
|
|
|
"items": {
|
2020-09-03 11:45:31 +08:00
|
|
|
|
"$ref": "/schemas/action.json#"
|
2020-08-21 15:28:22 +08:00
|
|
|
|
},
|
|
|
|
|
"type": "array"
|
|
|
|
|
},
|
|
|
|
|
"body": {
|
2020-09-03 11:45:31 +08:00
|
|
|
|
"$ref": "/schemas/page.json#/definitions/container",
|
2020-08-21 15:28:22 +08:00
|
|
|
|
"description": "内容区域"
|
|
|
|
|
},
|
|
|
|
|
"bodyClassName": {
|
2020-09-03 11:45:31 +08:00
|
|
|
|
"$ref": "/schemas/page.json#/definitions/className",
|
2020-08-21 15:28:22 +08:00
|
|
|
|
"description": "配置 Body 容器 className"
|
|
|
|
|
},
|
|
|
|
|
"className": {
|
2020-09-03 11:45:31 +08:00
|
|
|
|
"$ref": "/schemas/page.json#/definitions/className",
|
2020-08-21 15:28:22 +08:00
|
|
|
|
"description": "配置容器 className"
|
|
|
|
|
},
|
|
|
|
|
"closeOnEsc": {
|
|
|
|
|
"default": false,
|
|
|
|
|
"description": "是否支持按 ESC 关闭 drawer",
|
|
|
|
|
"type": "boolean"
|
2020-05-27 14:57:40 +08:00
|
|
|
|
},
|
2020-08-21 15:28:22 +08:00
|
|
|
|
"initApi": {
|
2020-09-03 11:45:31 +08:00
|
|
|
|
"$ref": "/schemas/page.json#/definitions/api",
|
2020-08-21 15:28:22 +08:00
|
|
|
|
"description": "页面初始化的时候,可以设置一个 API 让其取拉取,发送数据会携带当前 data 数据(包含地址栏参数),获取得数据会合并到 data 中,供组件内使用。"
|
|
|
|
|
},
|
|
|
|
|
"initFetch": {
|
|
|
|
|
"default": true,
|
|
|
|
|
"description": "是否默认就拉取?",
|
|
|
|
|
"type": "boolean"
|
|
|
|
|
},
|
|
|
|
|
"messages": {
|
|
|
|
|
"additionalProperties": false,
|
|
|
|
|
"properties": {
|
|
|
|
|
"fetchFailed": {
|
|
|
|
|
"description": "用来配置当 initApi 拉取失败时提示的信息",
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"fetchSuccess": {
|
|
|
|
|
"description": "用来配置当 initApi 拉取成功时提示的信息,当然不设置的话就不会提示。",
|
|
|
|
|
"type": "string"
|
2020-05-27 14:57:40 +08:00
|
|
|
|
}
|
2020-08-21 15:28:22 +08:00
|
|
|
|
},
|
|
|
|
|
"type": "object"
|
|
|
|
|
},
|
|
|
|
|
"name": {
|
2020-09-03 11:45:31 +08:00
|
|
|
|
"$ref": "/schemas/page.json#/definitions/name",
|
2020-08-21 15:28:22 +08:00
|
|
|
|
"description": "给当前 drawer 取个名字,可用来跟其他 Renderer 交互。"
|
|
|
|
|
},
|
|
|
|
|
"size": {
|
|
|
|
|
"description": "drawer 大小",
|
|
|
|
|
"enum": ["xs", "sm", "md", "lg", "xl"]
|
|
|
|
|
},
|
|
|
|
|
"title": {
|
2020-09-03 11:45:31 +08:00
|
|
|
|
"$ref": "/schemas/page.json#/definitions/container",
|
2020-08-21 15:28:22 +08:00
|
|
|
|
"default": "请通过配置 title 设置标题",
|
|
|
|
|
"description": "drawer 标题"
|
2020-05-27 14:57:40 +08:00
|
|
|
|
}
|
2020-08-21 15:28:22 +08:00
|
|
|
|
}
|
2020-05-27 14:57:40 +08:00
|
|
|
|
},
|
2020-08-21 15:28:22 +08:00
|
|
|
|
"test": {
|
|
|
|
|
"properties": {
|
|
|
|
|
"type": {
|
|
|
|
|
"const": "drawer"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"description": "amis drawer 渲染器,格式说明。https://baidu.github.io/amis/docs/renderers#drawer",
|
|
|
|
|
"type": "object"
|
|
|
|
|
}
|