Skip to content

Commit

Permalink
✨ feat: 增加 ApiHeader 组件导出
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Feb 14, 2023
1 parent f82c133 commit f597ab0
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions example/docs/components/ApiHeader.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
order: 1
title: ApiHeader 引用说明
atomId: ApiHeader
description: 简要介绍模块 Api 的头部说明
group: 功能组件
---

## Demo

<code src="./demos/ApiHeader"></code>

:::info
只有包裹在 `DumiSiteProvider` 里面才能正常使用。
:::

## API

| 属性名 | 描述 | 类型 | 默认值 |
| ----------- | ------------------------------------ | ---------------------------------- | ----------- |
| title | 标题 | `string` | `undefined` |
| description | 描述 | `string` | `undefined` |
| actions | 行动点,第一个 action 默认为 primary | `{ text: string; link: string }[]` | `undefined` |
22 changes: 22 additions & 0 deletions example/docs/components/demos/ApiHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* iframe: true
*/
import { ApiHeader, DumiSiteProvider } from 'dumi-theme-antd-style';
import { Flexbox } from 'react-layout-kit';

export default () => (
<DumiSiteProvider>
<Flexbox padding={24}>
<ApiHeader
title={'Button 按钮'}
pkg={'antd'}
componentName={'Button'}
description={'Ant Design 的按钮'}
docsUrl={'https://ant.design/components/button-cn'}
sourceUrl={
'https://github.com/ant-design/ant-design/blob/master/components/button/index.ts'
}
/>
</Flexbox>
</DumiSiteProvider>
);
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { ApiHeader } from './components/ApiHeader';
export { default as DumiSiteProvider } from './components/DumiSiteProvider';
export { default as Features } from './components/Features';
export { default as Footer } from './components/Footer';
Expand Down

1 comment on commit f597ab0

@vercel
Copy link

@vercel vercel bot commented on f597ab0 Feb 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.