Skip to content

Commit d11c9df

Browse files
committed
update
1 parent 179c1ef commit d11c9df

61 files changed

Lines changed: 185 additions & 3208 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/app-mobile/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"preview": "rsbuild preview"
1010
},
1111
"dependencies": {
12-
"@coding-form/form-antd-mobile": "workspace:*",
12+
"@coding-form/form-view": "workspace:*",
1313
"antd-mobile": "^5.42.3",
1414
"react": "^18.3.1",
1515
"react-dom": "^18.3.1"

packages/form-antd-mobile/src/components/string/index.tsx renamed to apps/app-mobile/src/components/string/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {Form, Input} from "antd-mobile";
22
import React from "react";
3-
import {FormItemProps} from "@/types/item";
4-
import {useFormContext} from "@coding-form/form-presenter";
3+
import {useFormContext,type FormItemProps} from "@coding-form/form-view";
54

65
export const FormString: React.FC<FormItemProps> = (props) => {
76

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import {useFormRegister} from "@coding-form/form-view";
2+
import {FormString} from "@/components/string";
3+
import {Form} from "antd-mobile";
4+
5+
export const registerForms = () => {
6+
7+
useFormRegister(Form,[
8+
{
9+
type: 'string',
10+
componentType:FormString
11+
}
12+
]);
13+
}

apps/app-mobile/src/index.tsx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom/client';
3-
import App from './App';
3+
import "./index.css";
4+
import HomePage from "@/pages/home.tsx";
5+
import {registerForms} from "@/config/form-register.tsx";
6+
7+
8+
const App = () => {
9+
10+
registerForms();
11+
12+
return (
13+
<HomePage/>
14+
)
15+
}
416

517
const rootEl = document.getElementById('root');
618
if (rootEl) {
7-
const root = ReactDOM.createRoot(rootEl);
8-
root.render(
9-
<React.StrictMode>
10-
<App />
11-
</React.StrictMode>,
12-
);
19+
const root = ReactDOM.createRoot(rootEl);
20+
root.render(
21+
<React.StrictMode>
22+
<App />
23+
</React.StrictMode>,
24+
);
1325
}
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import {useForm, FormAntdView} from "@coding-form/form-antd-mobile";
1+
import {createFormInstance, FormView} from "@coding-form/form-view";
22
import type {FormMeta} from "@coding-form/form-types";
33
import {Button, Space} from "antd-mobile";
44

5-
const App = () => {
5+
const HomePage = () => {
6+
67

78
const meta: FormMeta = {
89
name: "请假单",
@@ -21,11 +22,11 @@ const App = () => {
2122
subForms: []
2223
}
2324

24-
const form = useForm();
25+
const form = createFormInstance();
2526

2627
return (
2728
<div>
28-
<FormAntdView
29+
<FormView
2930
meta={meta}
3031
form={form}
3132
validators={[
@@ -79,4 +80,4 @@ const App = () => {
7980
);
8081
};
8182

82-
export default App;
83+
export default HomePage;

apps/app-pc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"preview": "rsbuild preview"
1010
},
1111
"dependencies": {
12-
"@coding-form/form-antd": "workspace:*",
12+
"@coding-form/form-view": "workspace:*",
1313
"antd": "^6.2.1",
1414
"react": "^18.3.1",
1515
"react-dom": "^18.3.1"

packages/form-antd/src/components/string/index.tsx renamed to apps/app-pc/src/components/string/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {Form, Input} from "antd";
22
import React from "react";
3-
import {FormItemProps} from "@/types/item";
4-
import {useFormContext} from "@coding-form/form-presenter";
3+
import {useFormContext,type FormItemProps} from "@coding-form/form-view";
54

65
export const FormString: React.FC<FormItemProps> = (props) => {
76

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import {useFormRegister} from "@coding-form/form-view";
2+
import {FormString} from "@/components/string";
3+
import {Form} from "antd";
4+
5+
export const registerForms = () => {
6+
7+
useFormRegister(Form,[
8+
{
9+
type: 'string',
10+
componentType:FormString
11+
}
12+
]);
13+
}

0 commit comments

Comments
 (0)