amis2/examples/components/Form/Editor.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

47 lines
931 B
JavaScript

import React from 'react';
export default {
title: 'Editor',
body: [
{
type: 'form',
api: '/api/mock2/saveForm?waitSeconds=2',
title: '',
body: [
{
name: 'javascript',
type: 'editor',
label: 'Javascript',
language: 'javascript',
value: 'console.log(1, 2, 3);'
},
{
name: 'html',
type: 'editor',
language: 'html',
label: 'Html',
value:
'<html><head><title>Hello</title></head><body><p>world</p></body></html>'
},
{
name: 'css',
type: 'editor',
language: 'css',
label: 'CSS',
value: 'body {color: red;}'
},
{
name: 'json',
type: 'editor',
language: 'json',
label: 'JSON',
value: `{"a": 1, "b": 2}`
}
]
}
]
};