Skip to content

Commit b99b1c9

Browse files
author
wangshuhan
committed
feat: empty-component
1 parent 21d219a commit b99b1c9

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/components/Empty/index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
nav:
3+
title: 组件
4+
order: 0
5+
group:
6+
title: 数据展示
7+
order: 2
8+
---
9+
10+
# Empty 空态
11+
12+
空状态时的展示占位图。
13+
14+
```jsx
15+
import { Empty } from 'react-haki';
16+
17+
export default () => <Empty title="Hello dumi!" />;
18+
```

src/components/Empty/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React, { type FC } from 'react';
2+
3+
const Empty: FC<{ title: string }> = (props) => <h4>{props.title}</h4>;
4+
5+
export default Empty;

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/** 组件 */
22
export { default as Ellipsis } from './components/Ellipsis';
3+
export { default as Empty } from './components/Empty';
34
export { default as Foo } from './components/Foo';
45
export { default as RichTextEllipsis } from './components/RichTextEllipsis';
56
export { default as SearchBar } from './components/SearchBar';

0 commit comments

Comments
 (0)