Skip to content

Commit

Permalink
doc: add timeline doc (#150)
Browse files Browse the repository at this point in the history
* doc: edit layout

* component: add steps component

* edit doc clash

* doc: add steps doc

* component: add timeLine component

* doc: add timeLine doc

* doc: edit steps doc
  • Loading branch information
yaob421123 committed Aug 6, 2021
1 parent bfdf2a2 commit b5e562f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/Steps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ function Demo() {
| 参数 | 说明 | 类型 | 默认值 |
| -------------------- | ------------ | ------- | ------- |
| `title` |步骤标题 | Item[] | - |
| `desc` | 步骤说明文字 | Number | 0 |
| `desc` | 步骤说明文字 | String | - |
| `status` | 步骤的状态,'success' 或 'error' | String | - |
2 changes: 1 addition & 1 deletion packages/core/src/Timeline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Timeline 时间轴
### 基础示例

```jsx
import { Steps } from '@uiw/react-native';
import { Timeline } from '@uiw/react-native';

function Demo() {
return (
Expand Down
11 changes: 11 additions & 0 deletions website/src/pages/components/timeLine/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Markdown, { importAll } from '../../../component/Markdown';

export default class Page extends Markdown {
path="/packages/core/src/Timeline/README.md"
getMarkdown = async () => {
const md = await import('@uiw/react-native/lib/Timeline/README.md');
// 支持 markdown 中,相对于当前 index.tsx 相对路径引入图片资源
importAll((require as any).context('./', true, /\.(png|gif|jpg)$/), this.imageFiles);
return md.default || md;
}
}
1 change: 1 addition & 0 deletions website/src/routes/menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const componentMenus: MenuData[] = [
{ path: "/components/grid", name: "Grid 宫格" },
{ path: "/components/list", name: "List 列表" },
{ path: "/components/steps", name: "Steps 步骤条" },
{ path: "/components/timeLine", name: "Timeline 时间轴" },
{ divider: true, name: "Feedback" },
{ path: "/components/loader", name: "Loader 加载" },
{ path: "/components/modal", name: "Modal 模态框" },
Expand Down
3 changes: 3 additions & 0 deletions website/src/routes/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,7 @@ export const getRouterData = {
'/components/steps': {
component: dynamicWrapper([], () => import('../pages/components/steps')),
},
'/components/timeLine': {
component: dynamicWrapper([], () => import('../pages/components/timeLine')),
},
};

0 comments on commit b5e562f

Please sign in to comment.