diff --git a/src/components/NoticeIcon/NoticeIconTab.d.ts b/src/components/NoticeIcon/NoticeIconTab.d.ts index 283c447fb70ee9e279815d90b55e4669017e9c91..99be5957f0a6eb3c7953a27791e48655a60e3773 100644 --- a/src/components/NoticeIcon/NoticeIconTab.d.ts +++ b/src/components/NoticeIcon/NoticeIconTab.d.ts @@ -14,7 +14,7 @@ export interface INoticeIconTabProps { emptyText?: React.ReactNode; emptyImage?: string; style?: React.CSSProperties; - hideClear?: boolean; + showClear?: boolean; } export default class NoticeIconTab extends React.Component {} diff --git a/src/components/NoticeIcon/NoticeList.js b/src/components/NoticeIcon/NoticeList.js index d574a24bb6b6ce7ded236bb9d96c4d86453b88c6..cafd65628ab60fb69f111789b76fd0b699ab0f49 100644 --- a/src/components/NoticeIcon/NoticeList.js +++ b/src/components/NoticeIcon/NoticeList.js @@ -11,7 +11,7 @@ export default function NoticeList({ locale, emptyText, emptyImage, - hideClear, + showClear = true, }) { if (data.length === 0) { return ( @@ -52,12 +52,12 @@ export default function NoticeList({ ); })} - {hideClear ? null : ( + {showClear ? (
{locale.clear} {title}
- )} + ) : null} ); } diff --git a/src/components/NoticeIcon/index.en-US.md b/src/components/NoticeIcon/index.en-US.md index ad0233d87106cefcb1767ade64e0ccccda175d28..e7448060e80ff1b97126ec72bc02b847b5752400 100644 --- a/src/components/NoticeIcon/index.en-US.md +++ b/src/components/NoticeIcon/index.en-US.md @@ -9,7 +9,7 @@ order: 9 ## API -参数 | 说明 | 类型 | 默认值 +Property | Description | Type | Default ----|------|-----|------ count | Total number of messages | number | - loading | Popup card loading status | boolean | false @@ -23,18 +23,18 @@ locale | Default message text | Object | `{ emptyText: '暂无数据', clear: ' ### NoticeIcon.Tab -参数 | 说明 | 类型 | 默认值 +Property | Description | Type | Default ----|------|-----|------ title | header for message Tab | string | - list | List data, format refer to the following table | Array | `[]` -hideClear | Clear button display status | boolean | false +showClear | Clear button display status | boolean | true emptyText | message text when list is empty | ReactNode | - emptyImage | image when list is empty | string | - ### Tab data -参数 | 说明 | 类型 | 默认值 +Property | Description | Type | Default ----|------|-----|------ avatar | avatar img url | string | - title | title | ReactNode | - diff --git a/src/components/NoticeIcon/index.zh-CN.md b/src/components/NoticeIcon/index.zh-CN.md index 5777e96a7e8cbd65a10ddce5fd3f1195c217fa29..b396bae39e061d81423b48e29050e914e2b8ec92 100644 --- a/src/components/NoticeIcon/index.zh-CN.md +++ b/src/components/NoticeIcon/index.zh-CN.md @@ -27,7 +27,7 @@ locale | 默认文案 | Object | `{ emptyText: '暂无数据', clear: '清空' } ----|------|-----|------ title | 消息分类的页签标题 | string | - list | 列表数据,格式参照下表 | Array | `[]` -hideClear | 是否显示清空按钮 | boolean | false +showClear | 是否显示清空按钮 | boolean | true emptyText | 针对每个 Tab 定制空数据文案 | ReactNode | - emptyImage | 针对每个 Tab 定制空数据图片 | string | -