amis:amis编辑器⽣成JSON使⽤⽅法。
这篇⽂章我们看⼀下amis如何⽣成JSON
点击进去后
左侧是组件 通过托拉拽到中间内容部分,完成⼀个布局上的操作。右侧是⼀些常规性的配置,接⼝字段样式等等的⼀些配置。当配置完成后点击左侧组件下的<;代码> ⽣成的是JSON格式。
结合上⼀篇⽂章,直接复制⽣成的JSON,通过接⼝保存到数据库,完成整个页⾯的渲染。这种操作对⽤户来说是⼀个零代码的开发。下⾯是我拉的⼀个简单的后台管理系统的集合,有兴趣的话可以体验⼀下
{
"type": "page",
"title": "增删改查⽰例",
"body": [
{
"type": "crud",
"draggable": true,
"api": "3xsw4ap8wah59.cfc-execute./api/amis-mock/sample?waitSeconds=1",
"perPage": 15,
图片的英文"keepItemSelectionOnPageChange": true,
"maxKeepItemSelectionLength": 11,
"labelTpl": "${id} ${engine}",
"filter": {
"title": "条件搜索",
"submitText": "",
"body": [
{
"type": "input-text",
"name": "keywords",
goldust"placeholder": "通过关键字搜索",
"addOn": {
"label": "搜索",
"type": "submit"
}
},
{
{
"type": "plain",
"text": "这⾥的表单项可以配置多个"
}
]
pants的音标},
"bulkActions": [
{
"label": "批量删除",
"actionType": "ajax",
"api": "delete:3xsw4ap8wah59.cfc-execute./api/amis-mock/sample/${ids|raw}", "confirmText": "确定要批量删除?"
},
{
"label": "批量修改",
"actionType": "dialog",
"dialog": {
"title": "批量编辑",
"name": "sample-bulk-edit",
"body": {
"type": "form",
"api": "3xsw4ap8wah59.cfc-execute./api/amis-mock/sample/bulkUpdate2", "body": [
{
"type": "hidden",
"name": "ids"
},
{
"type": "input-text",
"name": "engine",
"label": "Engine"
}
]
}
}
}
],
"quickSaveApi": "3xsw4ap8wah59.cfc-execute./api/amis-mock/sample/bulkUpdate", "quickSaveItemApi": "3xsw4ap8wah59.cfc-execute./api/amis-mock/sample/$id",
"filterTogglable": true,
"headerToolbar": [
"filter-toggler",
"bulkActions",
{
"type": "tpl",
"tpl": "定制内容⽰例:当前有 ${count} 条数据。",
"className": "v-middle"
},
{
"type": "columns-toggler",
"align": "right"
},
{
"type": "drag-toggler",
"align": "right"
},
{
"type": "pagination",
"align": "right"
}藏文在线翻译
],
"footerToolbar": [
"statistics",
"switch-per-page",
"pagination"
],
],
"columns": [
{
"name": "id",
"label": "ID",
"width": 20,
"sortable": true,
"type": "text",
"toggled": true,
"remark": "Bla bla Bla"
},
{
"name": "engine",已有的英文
"label": "Rendering engine",
"sortable": true,
"archable": true,
"popOver": {
"body": "Popover 内容:${platform}", "trigger": "hover"
},
"popOverEnableOn": "this.id === 1",
"type": "text",
"toggled": true
},
{
"name": "browr",
"label": "Browr",
"sortable": true,
"type": "text",
国庆节英语手抄报素材
"toggled": fal
},
{
"name": "platform",
"label": "Platform(s)",
"popOver": {
beard
"body": "Popover 内容:${platform}" },
"sortable": true,
"type": "text",
"toggled": true
},
{
"name": "version",
"label": "Engine version",
"quickEdit": true,
"type": "text",
"toggled": true,
"filterable": {
"options": [
{
"label": "4",
"value": "4"
},
{
"label": "5",
"value": "5"
},
{
"label": "6",
"value": "6"
}
]
}
spreads
},
{
"type": "text",
"type": "text",
"name": "grade",
"label": "CSS grade",
"quickEdit": {urp
"saveImmediately": true,
"mode": "inline",
"type": "lect",
"options": [
"A",
"B",
"C",
"D",
"X"
英语作文常用短语]
}
},
{
"type": "operation",
"label": "操作",
"width": 100,
"buttons": [
{
"type": "button",
"icon": "fa fa-eye",
"actionType": "dialog",
"tooltip": "查看",
"dialog": {
"title": "查看",
"body": {
"type": "form",
"body": [
{
"type": "static",
"name": "engine",
"label": "Engine"
},
{
"type": "divider"
},
{
"type": "static",
"name": "browr",
"label": "Browr"
},
{
"type": "divider"
},
{
"type": "static",
"name": "platform",
"label": "Platform(s)"
},
{
"type": "divider"
},
{
"type": "static",
"name": "version",
"label": "Engine version" },
{
"type": "divider"
},
{
"type": "static",
"name": "grade",