Skip to content

Commit 80fac54

Browse files
committed
doc(table): Add Table component README.md to website
1 parent 4301f98 commit 80fac54

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

packages/core/src/Drawer/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function Demo() {
5757
## 注意事项 - 抽屉高度是页面有效高度
5858

5959
```jsx
60-
import { Fragment } from 'react';
60+
import { Fragment, useState } from 'react';
6161
import { View, Text, SafeAreaView } from 'react-native';
6262
import { Drawer, Button } from '@uiw/react-native';
6363

@@ -101,7 +101,7 @@ export default () => {
101101

102102

103103
// 在使用组件页面
104-
import { Fragment } from 'react';
104+
import { Fragment, useState } from 'react';
105105
import { View, Text, SafeAreaView } from 'react-native';
106106
import { Drawer, Button } from '@uiw/react-native';
107107
import {RootSiblingPortal} from 'react-native-root-siblings';
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/Table/README.md';
5+
getMarkdown = async () => {
6+
const md = await import('@uiw/react-native/lib/Table/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
@@ -9,6 +9,7 @@ export const componentMenus: MenuData[] = [
99
{ divider: true, name: 'Layout' },
1010
{ path: '/components/divider', name: 'Divider 分割线' },
1111
{ path: '/components/flex', name: 'Flex 布局' },
12+
{ path: '/components/table', name: 'Table 表格' },
1213
{ path: '/components/spacing', name: 'Spacing 间距' },
1314
{ path: '/components/winblank', name: 'WingBlank 两翼留白' },
1415
{ divider: true, name: 'Navigation' },

website/src/routes/router.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ export const getRouterData = {
7878
'/components/flex': {
7979
component: dynamicWrapper([], () => import('../pages/components/flex')),
8080
},
81+
'/components/table': {
82+
component: dynamicWrapper([], () => import('../pages/components/table')),
83+
},
8184
'/components/spacing': {
8285
component: dynamicWrapper([], () => import('../pages/components/spacing')),
8386
},

0 commit comments

Comments
 (0)