0.0.39 • Published 11 months ago
@codingapi/form-pc v0.0.39
Form PC
基于PC的Form表单渲染引擎
安装
npm install @codingapi/form-pc
# 或者使用yarn
yarn add @codingapi/form-pc使用
Form表单的渲染
import React from "react";
import {Form} from "@codingapi/form-pc";
import {FormField} from "@codingapi/ui-framework";
const Test = () => {
const fields = [
{
type: 'input',
props: {
required: true,
name: ['user', 'name'],
label: '姓名',
placeholder: '请输入姓名',
validateFunction: async (content) => {
const value = content.value;
if (value) {
return []
}
return ['姓名不能为空']
}
}
}] as FormField[]
return (
<>
<Form
layout={"vertical"}
onFinish={async (values) => {
console.log(values);
}}
loadFields={async () => {
return fields;
}}
>
</Form>
</>
)
}
export default Test;更多示例请查看:https://github.com/codingapi/form-pc/tree/main/playground
主要特征
- 支持对常用的Form表单的组件渲染
- 即支持Meta数据渲染,也支持组件的渲染
- 支持对form表单的控制能力
- 支持表单字段的onChange、validate能力
开发
# Install dependencies
yarn install
# Start development server
yarn dev
# Build for production
yarn build
# Run tests
yarn test许可
Apache-2.0 © CodingAPI
0.0.39
11 months ago
0.0.38
11 months ago
0.0.37
11 months ago
0.0.36
11 months ago
0.0.30
11 months ago
0.0.28
11 months ago
0.0.24
11 months ago
0.0.23
11 months ago
0.0.22
11 months ago
0.0.21
12 months ago
0.0.20
12 months ago
0.0.18
12 months ago
0.0.17
12 months ago
0.0.16
12 months ago
0.0.15
12 months ago
0.0.14
12 months ago
0.0.13
12 months ago
0.0.12
12 months ago
0.0.11
12 months ago
0.0.10
12 months ago
0.0.9
12 months ago
0.0.8
12 months ago
0.0.7
12 months ago
0.0.6
12 months ago
0.0.4
12 months ago
0.0.3
12 months ago
0.0.2
12 months ago
0.0.1
12 months ago