@hw-component/form 0.0.1-beta → 0.0.1-beta-v2
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/es/CheckboxGroup/CheckBox/index.js +16 -24
- package/es/CheckboxGroup/hooks.d.ts +3 -9
- package/es/CheckboxGroup/hooks.js +64 -115
- package/es/CheckboxGroup/index.d.ts +1 -6
- package/es/CheckboxGroup/index.js +58 -117
- package/es/CheckboxGroup/modal.d.ts +8 -9
- package/es/Form/Context/FormConfigProvider.js +19 -64
- package/es/Form/Context/index.d.ts +1 -4
- package/es/Form/Context/index.js +3 -3
- package/es/Form/FormItem/BasicItem.js +42 -80
- package/es/Form/FormItem/Helper.d.ts +1 -1
- package/es/Form/FormItem/Helper.js +9 -17
- package/es/Form/FormItem/RegularFormItem.js +8 -11
- package/es/Form/FormItem/UpFormItem.d.ts +1 -6
- package/es/Form/FormItem/UpFormItem.js +17 -27
- package/es/Form/FormItem/hooks.d.ts +4 -21
- package/es/Form/FormItem/hooks.js +9 -12
- package/es/Form/FormItem/index.js +5 -5
- package/es/Form/HFormConnect.d.ts +1 -9
- package/es/Form/HFormConnect.js +30 -90
- package/es/Form/InitSet.d.ts +1 -4
- package/es/Form/InitSet.js +6 -7
- package/es/Form/Label.d.ts +4 -4
- package/es/Form/Label.js +19 -36
- package/es/Form/config.d.ts +22 -100
- package/es/Form/config.js +19 -19
- package/es/Form/hooks/index.d.ts +1 -14
- package/es/Form/hooks/index.js +32 -80
- package/es/Form/hooks/useHForm.js +143 -224
- package/es/Form/hooks/useInitConfigData.d.ts +1 -4
- package/es/Form/hooks/useInitConfigData.js +61 -143
- package/es/Form/index.d.ts +1 -11
- package/es/Form/index.js +79 -79
- package/es/Form/modal.d.ts +54 -89
- package/es/Input/ButtonInput.js +51 -73
- package/es/Input/InputNumber.js +12 -21
- package/es/Input/SelectInput.d.ts +4 -16
- package/es/Input/SelectInput.js +62 -116
- package/es/Input/defaultConfig.d.ts +3 -3
- package/es/Input/defaultConfig.js +2 -2
- package/es/Input/index.js +7 -7
- package/es/Input/modal.d.ts +13 -15
- package/es/ModalForm/hooks.d.ts +12 -0
- package/es/ModalForm/hooks.js +63 -0
- package/es/ModalForm/index.d.ts +4 -0
- package/es/ModalForm/index.js +72 -0
- package/es/ModalForm/modal.d.ts +20 -0
- package/es/PageHandler/ErrorComponent.js +25 -47
- package/es/PageHandler/LoadingComponent.js +13 -17
- package/es/PageHandler/index.js +7 -7
- package/es/PageHandler/modal.d.ts +4 -4
- package/es/RadioGroup/index.d.ts +5 -12
- package/es/RadioGroup/index.js +33 -46
- package/es/Select/components/AllSelect.d.ts +1 -1
- package/es/Select/components/AllSelect.js +18 -40
- package/es/Select/components/CheckBoxOption.d.ts +3 -6
- package/es/Select/components/CheckBoxOption.js +7 -12
- package/es/Select/components/DropdownComponent.d.ts +4 -4
- package/es/Select/components/DropdownComponent.js +17 -30
- package/es/Select/components/NoFindItem.d.ts +1 -1
- package/es/Select/components/NoFindItem.js +7 -11
- package/es/Select/components/NotFoundContent.d.ts +2 -2
- package/es/Select/components/NotFoundContent.js +27 -49
- package/es/Select/defaultConfig.d.ts +1 -1
- package/es/Select/defaultConfig.js +16 -20
- package/es/Select/hooks/changeHooks.d.ts +2 -2
- package/es/Select/hooks/changeHooks.js +71 -147
- package/es/Select/hooks/norHooks.d.ts +9 -27
- package/es/Select/hooks/norHooks.js +39 -51
- package/es/Select/index.d.ts +1 -22
- package/es/Select/index.js +65 -124
- package/es/Select/modal.d.ts +15 -15
- package/es/Select/utils.js +15 -60
- package/es/Submit/index.d.ts +3 -9
- package/es/Submit/index.js +13 -18
- package/es/Switch/index.d.ts +4 -4
- package/es/Switch/index.js +20 -46
- package/es/TDPicker/RangePicker.d.ts +3 -8
- package/es/TDPicker/RangePicker.js +67 -138
- package/es/TDPicker/TimePicker.d.ts +1 -6
- package/es/TDPicker/TimePicker.js +13 -19
- package/es/TDPicker/hooks.d.ts +22 -42
- package/es/TDPicker/hooks.js +72 -106
- package/es/TDPicker/index.d.ts +1 -7
- package/es/TDPicker/index.js +14 -20
- package/es/TDPicker/modal.d.ts +16 -21
- package/es/TextArea/index.d.ts +1 -0
- package/es/Upload/Btn.d.ts +1 -5
- package/es/Upload/Btn.js +19 -35
- package/es/Upload/MediaTypeEle/TypeEle.d.ts +5 -10
- package/es/Upload/MediaTypeEle/TypeEle.js +23 -31
- package/es/Upload/MediaTypeEle/index.d.ts +1 -5
- package/es/Upload/MediaTypeEle/index.js +18 -21
- package/es/Upload/Preview/index.d.ts +1 -5
- package/es/Upload/Preview/index.js +13 -17
- package/es/Upload/UrlUpload/index.d.ts +1 -7
- package/es/Upload/UrlUpload/index.js +51 -72
- package/es/Upload/enums.d.ts +3 -3
- package/es/Upload/enums.js +3 -3
- package/es/Upload/hooks/change.d.ts +1 -8
- package/es/Upload/hooks/change.js +58 -115
- package/es/Upload/hooks/customRequest.d.ts +1 -5
- package/es/Upload/hooks/customRequest.js +46 -63
- package/es/Upload/hooks/propsMaker.d.ts +1 -5
- package/es/Upload/hooks/propsMaker.js +13 -52
- package/es/Upload/index.d.ts +1 -3
- package/es/Upload/index.js +61 -131
- package/es/Upload/modal.d.ts +15 -17
- package/es/Upload/util.d.ts +2 -8
- package/es/Upload/util.js +7 -15
- package/es/config.js +31 -34
- package/es/hooks/index.d.ts +7 -14
- package/es/hooks/index.js +49 -124
- package/es/index.d.ts +18 -98
- package/es/index.js +8 -22
- package/es/modal.d.ts +6 -6
- package/lib/CheckboxGroup/CheckBox/index.js +18 -26
- package/lib/CheckboxGroup/hooks.d.ts +3 -9
- package/lib/CheckboxGroup/hooks.js +65 -116
- package/lib/CheckboxGroup/index.d.ts +1 -6
- package/lib/CheckboxGroup/index.js +60 -119
- package/lib/CheckboxGroup/modal.d.ts +8 -9
- package/lib/Form/Context/FormConfigProvider.js +21 -66
- package/lib/Form/Context/index.d.ts +1 -4
- package/lib/Form/Context/index.js +4 -4
- package/lib/Form/FormItem/BasicItem.js +44 -82
- package/lib/Form/FormItem/Helper.d.ts +1 -1
- package/lib/Form/FormItem/Helper.js +11 -19
- package/lib/Form/FormItem/RegularFormItem.js +10 -13
- package/lib/Form/FormItem/UpFormItem.d.ts +1 -6
- package/lib/Form/FormItem/UpFormItem.js +19 -29
- package/lib/Form/FormItem/hooks.d.ts +4 -21
- package/lib/Form/FormItem/hooks.js +10 -13
- package/lib/Form/FormItem/index.js +7 -7
- package/lib/Form/HFormConnect.d.ts +1 -9
- package/lib/Form/HFormConnect.js +32 -92
- package/lib/Form/InitSet.d.ts +1 -4
- package/lib/Form/InitSet.js +8 -9
- package/lib/Form/Label.d.ts +4 -4
- package/lib/Form/Label.js +21 -41
- package/lib/Form/config.d.ts +22 -100
- package/lib/Form/config.js +21 -21
- package/lib/Form/hooks/index.d.ts +1 -14
- package/lib/Form/hooks/index.js +32 -81
- package/lib/Form/hooks/useHForm.js +145 -226
- package/lib/Form/hooks/useInitConfigData.d.ts +1 -4
- package/lib/Form/hooks/useInitConfigData.js +63 -144
- package/lib/Form/index.d.ts +1 -11
- package/lib/Form/index.js +83 -83
- package/lib/Form/modal.d.ts +54 -89
- package/lib/Input/ButtonInput.js +53 -75
- package/lib/Input/InputNumber.js +14 -23
- package/lib/Input/SelectInput.d.ts +4 -16
- package/lib/Input/SelectInput.js +66 -128
- package/lib/Input/defaultConfig.d.ts +3 -3
- package/lib/Input/defaultConfig.js +3 -3
- package/lib/Input/index.js +9 -9
- package/lib/Input/modal.d.ts +13 -15
- package/lib/ModalForm/hooks.d.ts +12 -0
- package/lib/ModalForm/hooks.js +66 -0
- package/lib/ModalForm/index.d.ts +4 -0
- package/lib/ModalForm/index.js +75 -0
- package/lib/ModalForm/modal.d.ts +20 -0
- package/lib/PageHandler/ErrorComponent.js +27 -49
- package/lib/PageHandler/LoadingComponent.js +15 -19
- package/lib/PageHandler/index.js +9 -9
- package/lib/PageHandler/modal.d.ts +4 -4
- package/lib/RadioGroup/index.d.ts +5 -12
- package/lib/RadioGroup/index.js +35 -48
- package/lib/Select/components/AllSelect.d.ts +1 -1
- package/lib/Select/components/AllSelect.js +20 -42
- package/lib/Select/components/CheckBoxOption.d.ts +3 -6
- package/lib/Select/components/CheckBoxOption.js +9 -14
- package/lib/Select/components/DropdownComponent.d.ts +4 -4
- package/lib/Select/components/DropdownComponent.js +19 -32
- package/lib/Select/components/NoFindItem.d.ts +1 -1
- package/lib/Select/components/NoFindItem.js +9 -13
- package/lib/Select/components/NotFoundContent.d.ts +2 -2
- package/lib/Select/components/NotFoundContent.js +29 -51
- package/lib/Select/defaultConfig.d.ts +1 -1
- package/lib/Select/defaultConfig.js +17 -21
- package/lib/Select/hooks/changeHooks.d.ts +2 -2
- package/lib/Select/hooks/changeHooks.js +72 -148
- package/lib/Select/hooks/norHooks.d.ts +9 -27
- package/lib/Select/hooks/norHooks.js +40 -52
- package/lib/Select/index.d.ts +1 -22
- package/lib/Select/index.js +67 -128
- package/lib/Select/modal.d.ts +15 -15
- package/lib/Select/utils.js +16 -61
- package/lib/Submit/index.d.ts +3 -9
- package/lib/Submit/index.js +15 -20
- package/lib/Switch/index.d.ts +4 -4
- package/lib/Switch/index.js +22 -48
- package/lib/TDPicker/RangePicker.d.ts +3 -8
- package/lib/TDPicker/RangePicker.js +69 -136
- package/lib/TDPicker/TimePicker.d.ts +1 -6
- package/lib/TDPicker/TimePicker.js +15 -21
- package/lib/TDPicker/hooks.d.ts +22 -42
- package/lib/TDPicker/hooks.js +72 -98
- package/lib/TDPicker/index.d.ts +1 -7
- package/lib/TDPicker/index.js +16 -22
- package/lib/TDPicker/modal.d.ts +16 -21
- package/lib/TextArea/index.d.ts +1 -0
- package/lib/Upload/Btn.d.ts +1 -5
- package/lib/Upload/Btn.js +21 -37
- package/lib/Upload/MediaTypeEle/TypeEle.d.ts +5 -10
- package/lib/Upload/MediaTypeEle/TypeEle.js +25 -33
- package/lib/Upload/MediaTypeEle/index.d.ts +1 -5
- package/lib/Upload/MediaTypeEle/index.js +20 -23
- package/lib/Upload/Preview/index.d.ts +1 -5
- package/lib/Upload/Preview/index.js +15 -19
- package/lib/Upload/UrlUpload/index.d.ts +1 -7
- package/lib/Upload/UrlUpload/index.js +53 -74
- package/lib/Upload/enums.d.ts +3 -3
- package/lib/Upload/enums.js +4 -4
- package/lib/Upload/hooks/change.d.ts +1 -8
- package/lib/Upload/hooks/change.js +59 -116
- package/lib/Upload/hooks/customRequest.d.ts +1 -5
- package/lib/Upload/hooks/customRequest.js +47 -64
- package/lib/Upload/hooks/propsMaker.d.ts +1 -5
- package/lib/Upload/hooks/propsMaker.js +15 -55
- package/lib/Upload/index.d.ts +1 -3
- package/lib/Upload/index.js +63 -133
- package/lib/Upload/modal.d.ts +15 -17
- package/lib/Upload/util.d.ts +2 -8
- package/lib/Upload/util.js +8 -16
- package/lib/config.js +32 -35
- package/lib/hooks/index.d.ts +7 -14
- package/lib/hooks/index.js +50 -125
- package/lib/index.d.ts +18 -98
- package/lib/index.js +10 -5
- package/lib/modal.d.ts +6 -6
- package/package.json +1 -1
- package/src/components/Form/InitSet.tsx +3 -5
- package/src/components/Form/hooks/index.ts +0 -20
- package/src/components/Form/hooks/useHForm.ts +8 -4
- package/src/components/Form/index.tsx +25 -7
- package/src/components/Form/modal.ts +4 -2
- package/src/components/Input/SelectInput.tsx +3 -2
- package/src/components/Input/modal.ts +2 -0
- package/src/components/ModalForm/hooks.ts +45 -0
- package/src/components/ModalForm/index.tsx +69 -0
- package/src/components/ModalForm/modal.ts +22 -0
- package/src/components/index.tsx +4 -0
- package/src/pages/ModalForm/index.tsx +127 -0
- package/src/routes.tsx +6 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Modal } from "antd";
|
|
2
|
+
import type { ModalFormProps } from "@/components/ModalForm/modal";
|
|
3
|
+
import HForm from "../Form";
|
|
4
|
+
import { useCurrentForm, useModifyProps } from "./hooks";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
export default ({
|
|
7
|
+
visible,
|
|
8
|
+
title,
|
|
9
|
+
onCancel,
|
|
10
|
+
configData,
|
|
11
|
+
infoRequest,
|
|
12
|
+
request,
|
|
13
|
+
afterClose,
|
|
14
|
+
modalForm,
|
|
15
|
+
initialValues = {},
|
|
16
|
+
...props
|
|
17
|
+
}: ModalFormProps) => {
|
|
18
|
+
const {
|
|
19
|
+
modalVisible,
|
|
20
|
+
modalFormData,
|
|
21
|
+
setModalVisible,
|
|
22
|
+
setModalFormData,
|
|
23
|
+
initValue,
|
|
24
|
+
setInitValue,
|
|
25
|
+
} = useModifyProps({ configData, visible, initialValues });
|
|
26
|
+
|
|
27
|
+
const currentForm = useCurrentForm(modalForm);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
currentForm.show = ({
|
|
30
|
+
configData: changeConfigData,
|
|
31
|
+
initialValues: changeInitialValues,
|
|
32
|
+
}) => {
|
|
33
|
+
if (!!changeConfigData) {
|
|
34
|
+
setModalFormData(changeConfigData);
|
|
35
|
+
}
|
|
36
|
+
setInitValue(changeInitialValues);
|
|
37
|
+
setModalVisible(true);
|
|
38
|
+
};
|
|
39
|
+
currentForm.hide = () => {
|
|
40
|
+
setModalVisible(false);
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
const cancel = (e) => {
|
|
44
|
+
if (onCancel) {
|
|
45
|
+
return onCancel?.(e);
|
|
46
|
+
}
|
|
47
|
+
setModalVisible(false);
|
|
48
|
+
};
|
|
49
|
+
return (
|
|
50
|
+
<Modal
|
|
51
|
+
title={title}
|
|
52
|
+
visible={modalVisible}
|
|
53
|
+
onCancel={cancel}
|
|
54
|
+
afterClose={() => {
|
|
55
|
+
currentForm.resetFields();
|
|
56
|
+
afterClose?.();
|
|
57
|
+
}}
|
|
58
|
+
{...props}
|
|
59
|
+
>
|
|
60
|
+
<HForm
|
|
61
|
+
configData={modalFormData}
|
|
62
|
+
initialValues={initValue}
|
|
63
|
+
{...props}
|
|
64
|
+
form={currentForm}
|
|
65
|
+
infoRequest={infoRequest}
|
|
66
|
+
/>
|
|
67
|
+
</Modal>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { HFormProps } from "@/components/Form/modal";
|
|
2
|
+
import type { ModalProps } from "antd";
|
|
3
|
+
import type { HFormInstance, HItemProps } from "@/components/Form/modal";
|
|
4
|
+
|
|
5
|
+
type RootProps = HFormProps & ModalProps;
|
|
6
|
+
|
|
7
|
+
export interface ModifyPropsModal {
|
|
8
|
+
configData: HItemProps[];
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
initialValues?: Record<string, any>;
|
|
11
|
+
}
|
|
12
|
+
export interface ShowParamsModal extends Partial<ModifyPropsModal> {
|
|
13
|
+
initialValues?: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface HModalFormInstance extends HFormInstance {
|
|
17
|
+
show: (data: ShowParamsModal) => void;
|
|
18
|
+
hide: VoidFunction;
|
|
19
|
+
}
|
|
20
|
+
export interface ModalFormProps extends RootProps {
|
|
21
|
+
modalForm?: HModalFormInstance;
|
|
22
|
+
}
|
package/src/components/index.tsx
CHANGED
|
@@ -3,6 +3,9 @@ import FormConfig from "./Form/config";
|
|
|
3
3
|
import PageHandler from "./PageHandler";
|
|
4
4
|
export { default as HForm } from "./Form";
|
|
5
5
|
export { default as useHForm } from "./Form/hooks/useHForm";
|
|
6
|
+
export { useHModalForm } from "./ModalForm/hooks";
|
|
7
|
+
|
|
8
|
+
import ModalForm from "./ModalForm";
|
|
6
9
|
export const HSelect = FormConfig.select;
|
|
7
10
|
export const HInput = FormConfig.input;
|
|
8
11
|
export const HSelectInput = FormConfig.selectInput;
|
|
@@ -19,3 +22,4 @@ export const HTimePicker = FormConfig.timePicker;
|
|
|
19
22
|
export const HInputNumber = FormConfig.inputNumber;
|
|
20
23
|
export const HPageHandler = PageHandler;
|
|
21
24
|
export const HFormConfigProvider = FormConfig.formConfigProvider;
|
|
25
|
+
export const HModalForm = ModalForm;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Button } from "antd";
|
|
2
|
+
import { HModalForm, useHModalForm } from "../../components";
|
|
3
|
+
const data = [
|
|
4
|
+
{
|
|
5
|
+
label: "输入框",
|
|
6
|
+
name: "name",
|
|
7
|
+
rules: [
|
|
8
|
+
() => {
|
|
9
|
+
return {
|
|
10
|
+
required: true,
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
label: "数字",
|
|
17
|
+
name: "sz",
|
|
18
|
+
type: "inputNumber",
|
|
19
|
+
rules: [{ required: true }],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: "下拉输入框",
|
|
23
|
+
name: "selectInput",
|
|
24
|
+
type: "selectInput",
|
|
25
|
+
rules: [{ required: true }],
|
|
26
|
+
itemProps: {
|
|
27
|
+
valueName: {
|
|
28
|
+
select: "op",
|
|
29
|
+
input: "opInput",
|
|
30
|
+
},
|
|
31
|
+
selectProps: {
|
|
32
|
+
options: [{ label: "测试", value: 1 }],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "按钮输入框",
|
|
38
|
+
name: "buttonInput",
|
|
39
|
+
type: "buttonInput",
|
|
40
|
+
children: "点击",
|
|
41
|
+
rules: [{ required: true }],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: "选择",
|
|
45
|
+
name: "checkboxGroup",
|
|
46
|
+
type: "checkboxGroup",
|
|
47
|
+
rules: [{ required: true }],
|
|
48
|
+
helper: "帮助我",
|
|
49
|
+
options: [
|
|
50
|
+
{ label: "选择1", value: "check1" },
|
|
51
|
+
{ label: "选择2", value: "check2" },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: "开关",
|
|
56
|
+
name: "switch",
|
|
57
|
+
type: "switch",
|
|
58
|
+
rules: [{ required: true }],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: "时间",
|
|
62
|
+
name: "datePicker",
|
|
63
|
+
type: "datePicker",
|
|
64
|
+
hover: "时间选择",
|
|
65
|
+
helper: "帮助我",
|
|
66
|
+
rules: [{ required: true }],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: "时间段",
|
|
70
|
+
name: "rangePicker",
|
|
71
|
+
type: "rangePicker",
|
|
72
|
+
helper: "帮助我",
|
|
73
|
+
rules: [{ required: true }],
|
|
74
|
+
itemProps: {
|
|
75
|
+
valueMap: {
|
|
76
|
+
start: "testStart",
|
|
77
|
+
end: "testEnd",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: "时分秒",
|
|
83
|
+
name: "timePicker",
|
|
84
|
+
type: "timePicker",
|
|
85
|
+
rules: [{ required: true }],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: "文件",
|
|
89
|
+
name: "upload",
|
|
90
|
+
type: "upload",
|
|
91
|
+
rules: [{ required: true }],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
label: "地址文件",
|
|
95
|
+
name: "urlUpload",
|
|
96
|
+
type: "urlUpload",
|
|
97
|
+
rules: [{ required: true }],
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
export default () => {
|
|
101
|
+
const modalForm = useHModalForm();
|
|
102
|
+
return (
|
|
103
|
+
<>
|
|
104
|
+
<Button
|
|
105
|
+
onClick={() => {
|
|
106
|
+
modalForm.show({
|
|
107
|
+
initialValues: {
|
|
108
|
+
check1: 1,
|
|
109
|
+
testStart: "1694747960",
|
|
110
|
+
testEnd: "1693538359",
|
|
111
|
+
op: 1,
|
|
112
|
+
opInput: "12121",
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
打开
|
|
118
|
+
</Button>
|
|
119
|
+
<HModalForm
|
|
120
|
+
configData={data}
|
|
121
|
+
labelWidth={88}
|
|
122
|
+
modalForm={modalForm}
|
|
123
|
+
title="测试"
|
|
124
|
+
/>
|
|
125
|
+
</>
|
|
126
|
+
);
|
|
127
|
+
};
|
package/src/routes.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import Switch from "./pages/Switch";
|
|
|
8
8
|
import DatePicker from "./pages/DatePicker";
|
|
9
9
|
import Upload from "./pages/Upload";
|
|
10
10
|
import Form from "./pages/Form";
|
|
11
|
-
|
|
11
|
+
import ModalForm from "./pages/ModalForm";
|
|
12
12
|
export interface RouteModal {
|
|
13
13
|
path?: string;
|
|
14
14
|
name?: string;
|
|
@@ -63,6 +63,11 @@ const routes: RouteModal[] = [
|
|
|
63
63
|
name: "表单",
|
|
64
64
|
element: <Form />,
|
|
65
65
|
},
|
|
66
|
+
{
|
|
67
|
+
path: "/modalForm",
|
|
68
|
+
name: "弹窗表单",
|
|
69
|
+
element: <ModalForm />,
|
|
70
|
+
},
|
|
66
71
|
];
|
|
67
72
|
|
|
68
73
|
export default routes;
|