Low Code Design
约 1 分钟阅读
标签:设计
- Low Code - 讲究 编辑,关联,任意 组件
- 组件的特性
- 配置化
- Schema化
- 可以参考设计,只实现配置化
- 模型
- ProseMirror 的 Schema 模型值得借鉴参考
- HTML/JSX - type/tag, attributes, children
- 模型=序列化
- 序列化 元素 - 最简单
- 序列化 操作 - 事件
- 序列化 状态 - 响应、条件
// React Element 模型
const reactElement = {
// 类型识别
$$typeof: REACT_ELEMENT_TYPE,
// 组件类型
type: type,
key: key,
ref: ref,
props: props, // dev 时 Object.freeze
};- x-render笔记x-renderschema 基于 json-schema · fr-generator - 表单设计器 · https://xrender.fun/generator/playground打开:/notes/web/editor/x-render
- 基于 JSON schema 扩展处理属性
百度 Aims
{
// 注册的类型
"type": "page",
// 组件能处理的属性
"title": "Demo",
// children
"body": [
{
"type": "form",
"actions": [],
"debug": true,
"mode": "horizontal",
// 配置表单处理逻辑
"api": {
"method": "post",
"url": "/amis/api/mock2/form/saveForm",
"data": {
// 数据替换
"user.name": "${name|default:undefined}",
"email": "${email}"
}
},
"body": [
{
"type": "radios",
"name": "status",
"value": "1",
"label": "状态",
"options": {
"1": "离线",
"2": "在线"
}
},
{
"type": "mapping",
"name": "status",
"label": "状态展示",
"map": {
"1": "离线",
"2": "在线"
},
// 根据状态变化类型
"className": {
"text-muted": "this.status == '1'",
"text-success": "this.status == '2'"
}
},
{
"type": "select",
// 定义 select 的数据源
"source": {
"method": "get",
"url": "/amis/api/mock2/options/level2?a=${a}",
"sendOn": "this.a === 2"
}
}
]
}
]
}关联信息
反向链接、本文链接的其他页面和外部资料。
反向链接
- Editor Awesome笔记 · Low Code Design
推荐👍 Lexical, Tiptap, QuillJS · React 优先建议选择 Lexical,否则考虑 tiptap/prosemirror · prosemirror · 实现 Editor 的基础库 · tiptap · Hufe921/canvas-editor
站内链接
- x-render笔记 · x-render
schema 基于 json-schema · fr-generator - 表单设计器 · https://xrender.fun/generator/playground