阿里lowcode-engine生态项目,基于 antd 和 formily 组件库实现,包括 plugins、setters 和 materials。
首先在项目根目录安装依赖:
// 根目录安装依赖
yarn bootstrap
直接到 packages/antd-setters
和 packages/antd-plugins
中开发即可。具体效果可以通过启动 demo 项目进行调试。
demo 项目基于 umi4 实现,配置 alias 指向 packages 里面的包,修改 packages 里面的代码可以实现热更新调试。
// 在 demo 目录或者项目根目录执行 yarn start 启动 demo,打开lcoalhost:8000即可访问
yarn start
在 assets.json 文件注册物料:
{
"packages": [
{
"package": "@dslc/antd-materials",
"version": "0.1.1",
"library": "SeadaAntdMaterials",
"urls": [
"https://unpkg.com/@dslc/antd-materials@latest/build/lowcode/view.js",
"https://unpkg.com/@dslc/antd-materials@latest/build/lowcode/view.css"
],
"editUrls": [
"https://unpkg.com/@dslc/antd-materials@latest/build/lowcode/view.js",
"https://unpkg.com/@dslc/antd-materials@latest/build/lowcode/view.css"
]
}
],
"components": [
{
"exportName": "SeadaAntdMaterialsMeta",
"npm": {
"package": "@dslc/antd-materials",
"version": "0.1.1"
},
"url": "https://unpkg.com/@dslc/antd-materials@latest/build/lowcode/meta.js",
"urls": {
"default": "https://unpkg.com/@dslc/antd-materials@latest/build/lowcode/meta.js"
}
}
]
}
- 安装 Formily Plugin
// formily相关依赖
npm install @formily/core @formily/react antd moment @formily/antd
// plugin
npm install @dslc/antd-plugins
使用插件
import { PluginFormily } from '@dslc/antd-plugins'
import { plugins } from '@alilc/lowcode-engine'
async function registerFormilyPlugins() {
await plugins.register(PluginFormily)
}
registerFormilyPlugins()
- 在 assets.json 文件注册物料:
{
"packages": [
{
"package": "@dslc/formily-materials",
"version": "0.1.1",
"library": "DslcFormilyMaterials",
"urls": [
"https://unpkg.com/@dslc/formily-materials@latest/build/lowcode/view.js",
"https://unpkg.com/@dslc/formily-materials@latest/build/lowcode/view.css"
],
"editUrls": [
"https://unpkg.com/@dslc/formily-materials@latest/build/lowcode/view.js",
"https://unpkg.com/@dslc/formily-materials@latest/build/lowcode/view.css"
]
}
],
"components": [
{
"exportName": "DslcFormilyMaterialsMeta",
"npm": {
"package": "@dslc/formily-materials",
"version": "0.1.1"
},
"url": "https://unpkg.com/@dslc/formily-materials@latest/build/lowcode/meta.js",
"urls": {
"default": "https://unpkg.com/@dslc/formily-materials@latest/build/lowcode/meta.js"
}
}
]
}
lowcode-ecology is open source software licensed as MIT.