amis/examples/components/Services/Schema.jsx
liaoxuezhi 65ac422ed6
1.2.x 文档&示例配置调整 (#2064)
* 补充容错

* fix: form 中 name 关联顶层数据初始化失效

* 更新 examples

* 文档调整

* 删除多余的文档, 调整 schema

* schema 调整

* schema 调整

* control 类型容器 control 改成 body

* 修复一个选项加载的bug

* form 注册直接用 type
2021-06-07 10:09:55 +08:00

51 lines
1.0 KiB
JavaScript

export default {
type: 'page',
title: '动态加载页面',
body: [
'<span class="text-danger">可以通过 <code>service</code>的<code>schemaApi</code> 动态控制内容。</span>',
{
type: 'form',
title: '条件输入',
panelClassName: 'panel-info m-t',
target: 'service1',
mode: 'inline',
submitOnInit: true,
body: [
{
label: '加载页面类型',
required: true,
type: 'button-group-select',
submitOnChange: true,
value: 'crud',
name: 'type',
options: [
{
label: 'Crud',
value: 'crud'
},
{
label: 'Form',
value: 'form'
},
{
label: 'Tabs',
value: 'tabs'
}
]
}
]
},
{
name: 'service1',
type: 'service',
className: 'm-t',
initFetchSchema: false,
schemaApi: '/api/mock2/service/schema?type=$type'
}
]
};