🚀
开箱即用
60+ 精心打造的企业级组件,覆盖表单、表格、图表等核心场景,零配置即可快速上手
几行代码,即可构建复杂的企业级表单
<template>
<DynamicForm :model-value="model" class="dynamic-form-demo" :config="formConfig" @click="handleClick"/>
</template>
<script lang="ts" setup>
import { reactive } from 'vue';
import { DynamicForm } from '@erp/biz';
import type { DynamicFormI, PageExpose } from '@erp/biz';
const model = reactive({});
const formConfig: DynamicFormI = {
title: '商品订单',
showSide: false,
cols: 3,
colGap: 12,
buttons: [
{
label: '提交',
code: 'submit',
type: 'primary',
validator: true,
},
{
label: '取消',
code: 'cancel',
type: 'info',
},
],
ons: {
change(params) {
console.log(params);
}
},
fields: [
{
key: 'address',
label: '地市',
type: 'cascader',
componentProps: {
pathMode: true,
},
options: [
{
value: 'beijing',
label: 'Beijing',
children: [
{
value: 'chaoyang',
label: 'ChaoYang',
children: [
{
value: 'datunli',
label: 'Datunli',
},
],
},
{
value: 'haidian',
label: 'Haidian',
},
{
value: 'dongcheng',
label: 'Dongcheng',
},
{
value: 'xicheng',
label: 'Xicheng',
children: [
{
value: 'jinrongjie',
label: 'Jinrongjie',
},
{
value: 'tianqiao',
label: 'Tianqiao',
},
],
},
],
},
{
value: 'shanghai',
label: 'Shanghai',
children: [
{
value: 'huangpu',
label: 'Huangpu',
},
],
},
],
},
{
key: 'orderType',
label: '订单类型',
type: 'select',
required: true,
options: [
{
value: '1',
label: '订单类型一',
},
],
},
{
key: 'key2.key',
label: '店铺',
required: true,
type: 'select-shop',
},
{
key: 'key3',
label: '下单时间',
type: 'date',
},
{
key: 'key4',
label: '运费',
type: 'number',
},
{
key: 'key5',
label: '买家账号',
type: 'text',
required: true,
},
{
key: 'key6',
label: '买家名称',
type: 'text',
required: true,
},
{
key: 'key7',
label: '业务员',
type: 'select',
required: true,
options: [],
},
{
key: 'key8',
label: '商机编号',
type: 'text',
},
{
key: 'key9',
label: '经销商',
type: 'text',
},
{
key: 'key10',
label: '派单人员',
type: 'select',
options: [],
},
{
key: 'key11',
label: '归属手机',
type: 'text',
rules: {
type: 'string',
validator(value, callback) {
// 校验手机
callback();
},
},
},
],
};
const handleClick = (button, errors) => {
console.log('click', button, errors);
}
defineExpose<PageExpose>({
getModel() {
return model.value;
},
});
</script>Tree Shaking 友好,只打包使用的组件,构建体积减少 60%
内置 i18n 方案,支持中英日韩等 20+ 语言,满足全球化需求
自适应多端布局,桌面、平板、移动端完美适配
活跃的社区支持,每月发布新版本,快速响应需求
只需几分钟,即可在项目中使用 ERP 组件库