@hzab/form-render-mobile 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,19 +9,47 @@
9
9
  ## 示例
10
10
 
11
11
  ```jsx
12
+ import { useRef } from "react";
12
13
  import FormRender from "@hzab/form-render-mobile";
13
- import Schema from './test.schema.json'
14
14
 
15
- <FormRender schema={schema} />;
15
+ import Schema from "./test.schema.json";
16
+
17
+ export default () => {
18
+ const formRef = useRef({
19
+ formRender: Object,
20
+ });
21
+
22
+ function onClick() {
23
+ console.log(JSON.stringify(formRef?.current?.formRender.values));
24
+ }
25
+
26
+ return (
27
+ <div>
28
+ <FormRender ref={formRef} schema={Schema} initialValues={ipt:'xxxxssss'} />
29
+ <button onClick={onClick}>提交</button>
30
+ </div>
31
+ );
32
+ };
16
33
  ```
17
34
 
18
35
  ## API
19
36
 
20
37
  ### InfoPanel Attributes
21
38
 
22
- | 参数 | 类型 | 必填 | 默认值 | 说明 |
23
- | ------ | ------ | ---- | ------ | ----------------- | --- |
24
- | schema | Object | 是 | - | 数据信息的 schema | |
39
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
40
+ | ------------- | --------------------- | ---- | ------ | ----------------------------- | --- |
41
+ | schema | Object | 是 | - | 数据信息的 schema | |
42
+ | className | string | 否 | - | 元素类名 | |
43
+ | initialValues | Object | 否 | - | 表单初始值 | |
44
+ | schemaScope | Object | 否 | - | formily scope 自定义数据 | |
45
+ | components | SchemaReactComponents | 否 | - | formily 自定义组件 | |
46
+ | readOnly | boolean | 否 | - | 是否只读 | |
47
+ | disabled | boolean | 否 | - | 是否禁用 | |
48
+ | formOptions | Object | 否 | - | createForm 配置项 | |
49
+ | hasSubmit | boolean | 否 | - | 是否有提交按钮 | |
50
+ | onSubmit | Function | 否 | - | 提交事件 (values): void | |
51
+ | init | Function | 否 | - | 组件初始化 (form): void | |
52
+ | footerRender | Function | 否 | - | 底部渲染插槽 (): ReactElement | |
25
53
 
26
54
  # 组件开发流程
27
55
 
@@ -39,7 +67,8 @@ import Schema from './test.schema.json'
39
67
  ## 命令
40
68
 
41
69
  - Mac 执行该命令,设置 pre-commit 为可执行文件
42
- - npm run mac-chmod
70
+
71
+ - npm run mac-chmod
43
72
  - chmod +x .husky && chmod +x .husky/pre-commit
44
73
 
45
74
  - 生成文档:npm run docs