Skip to content

Commit 6e968fe

Browse files
committed
docs(website): 更新Form组件文档
1 parent 85e14e3 commit 6e968fe

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

packages/core/src/Form/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Form 表单
77

88
<!--DemoStart-->
99
```jsx
10-
import { SafeAreaView } from 'react-native';
10+
import { SafeAreaView } from 'react-native';
1111
import { Form } from '@uiw/react-native';
1212

1313
const FormDemo = () => {
@@ -33,8 +33,8 @@ const FormDemo = () => {
3333

3434
<!--DemoStart-->
3535
```jsx
36-
import { SafeAreaView,Toast } from 'react-native';
37-
import { Form } from '@uiw/react-native';
36+
import { SafeAreaView,Toast } from 'react-native';
37+
import { Form,Button } from '@uiw/react-native';
3838

3939
const FormDemo = () => {
4040
const form = Form.useForm();
@@ -72,7 +72,7 @@ const FormDemo = () => {
7272

7373
<!--DemoStart-->
7474
```jsx
75-
import { SafeAreaView,Toast,Slider } from 'react-native';
75+
import { SafeAreaView,Slider } from 'react-native';
7676
import { Form } from '@uiw/react-native';
7777

7878
const FormDemo = () => {
@@ -96,7 +96,7 @@ const FormDemo = () => {
9696
];
9797
return (
9898
<SafeAreaView>
99-
<Form form={form} schema={items} changeValidate={true} customComponentList={customComponentList} initialValues={initialValues} />
99+
<Form form={form} schema={items} customComponentList={customComponentList} initialValues={initialValues} />
100100
</SafeAreaView>
101101
);
102102
};
@@ -107,7 +107,7 @@ const FormDemo = () => {
107107

108108
<!--DemoStart-->
109109
```jsx
110-
import { SafeAreaView,Toast } from 'react-native';
110+
import { SafeAreaView } from 'react-native';
111111
import { Form } from '@uiw/react-native';
112112

113113
const FormDemo = () => {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Markdown, { importAll } from '../../../component/Markdown';
2+
3+
export default class Page extends Markdown {
4+
path = '/packages/core/src/Form/README.md';
5+
getMarkdown = async () => {
6+
const md = await import('@uiw/react-native/lib/Form/README.md');
7+
// 支持 markdown 中,相对于当前 index.tsx 相对路径引入图片资源
8+
importAll((require as any).context('./', true, /\.(png|gif|jpg|svg)$/), this.imageFiles);
9+
return md.default || md;
10+
};
11+
}

website/src/routes/menus.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const componentMenus: MenuData[] = [
1919
{ path: '/components/expandablesection', name: 'ExpandableSection 展开缩放组件' },
2020
{ path: '/components/cardcollapse', name: 'CardCollapse 可折叠卡片列表' },
2121
{ divider: true, name: 'Data Entry' },
22+
{ path: '/components/form', name: 'Form 表单' },
2223
{ path: '/components/buttongroup', name: 'ButtonGroup 按钮组' },
2324
{ path: '/components/checkbox', name: 'CheckBox 复选框' },
2425
{ path: '/components/calendar', name: 'Calendar 日历' },

website/src/routes/router.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ export const routeData = [
289289
path: '/components/imageViewer',
290290
component: lazy(() => import('../pages/components/imageViewer')),
291291
},
292+
{
293+
path: '/components/form',
294+
component: lazy(() => import('../pages/components/form')),
295+
},
292296
{
293297
path: '/docs/changelog',
294298
component: lazy(() => import('../pages/docs/changelog')),

0 commit comments

Comments
 (0)