diff --git a/src/components/GlobalHeader/RightContent.js b/src/components/GlobalHeader/RightContent.js index 74d494547ff0f4c1077d7e23d0195087822bb4a2..dce334c609aa39ff83f8c190ea863bfca8c57bb7 100644 --- a/src/components/GlobalHeader/RightContent.js +++ b/src/components/GlobalHeader/RightContent.js @@ -117,18 +117,21 @@ export default class GlobalHeaderRight extends PureComponent { diff --git a/src/components/NoticeIcon/NoticeIconTab.d.ts b/src/components/NoticeIcon/NoticeIconTab.d.ts index f9786f85d0b097d6df1d68ffe5207ccf0df31dd8..061cdb6d7b689bcb6e53210294b89248cd48bbe9 100644 --- a/src/components/NoticeIcon/NoticeIconTab.d.ts +++ b/src/components/NoticeIcon/NoticeIconTab.d.ts @@ -11,6 +11,7 @@ export interface INoticeIconData { export interface INoticeIconTabProps { list?: INoticeIconData[]; title?: string; + name?: string; emptyText?: React.ReactNode; emptyImage?: string; style?: React.CSSProperties; diff --git a/src/components/NoticeIcon/index.d.ts b/src/components/NoticeIcon/index.d.ts index e29d5587615bdfff3906c42e7897b75db7f1f5e5..6f7c8c1195794be42f4c1a7d4f35f12eed9ebc71 100644 --- a/src/components/NoticeIcon/index.d.ts +++ b/src/components/NoticeIcon/index.d.ts @@ -6,9 +6,9 @@ export interface INoticeIconProps { bell?: React.ReactNode; className?: string; loading?: boolean; - onClear?: (tableTile: string) => void; + onClear?: (tabName: string) => void; onItemClick?: (item: INoticeIconData, tabProps: INoticeIconProps) => void; - onTabChange?: (tableTile: string) => void; + onTabChange?: (tabTile: string) => void; popupAlign?: { points?: [string, string]; offset?: [number, number]; diff --git a/src/components/NoticeIcon/index.en-US.md b/src/components/NoticeIcon/index.en-US.md index 95c3f7b483b4d3d57ffb11206fc0011c6fba35e6..5352ce6c0e34c3f2654e386508ba22885af3d069 100644 --- a/src/components/NoticeIcon/index.en-US.md +++ b/src/components/NoticeIcon/index.en-US.md @@ -14,7 +14,7 @@ Property | Description | Type | Default count | Total number of messages | number | - bell | Change the bell Icon | ReactNode | `` loading | Popup card loading status | boolean | false -onClear | Click to clear button the callback | function(tabTitle) | - +onClear | Click to clear button the callback | function(tabName) | - onItemClick | Click on the list item's callback | function(item, tabProps) | - onTabChange | Switching callbacks for tabs | function(tabTitle) | - popupAlign | Popup card location configuration | Object [alignConfig](https://github.com/yiminghe/dom-align#alignconfig-object-details) | - @@ -27,6 +27,7 @@ locale | Default message text | Object | `{ emptyText: '暂无数据', clear: ' Property | Description | Type | Default ----|------|-----|------ title | header for message Tab | string | - +name | identifier for message Tab | string | - list | List data, format refer to the following table | Array | `[]` showClear | Clear button display status | boolean | true emptyText | message text when list is empty | ReactNode | - diff --git a/src/components/NoticeIcon/index.js b/src/components/NoticeIcon/index.js index af627e679d0c351c69d99909a640c61bdd36d22e..64146222b46c5dbc3683d07178ea65e14a886082 100644 --- a/src/components/NoticeIcon/index.js +++ b/src/components/NoticeIcon/index.js @@ -44,12 +44,12 @@ export default class NoticeIcon extends PureComponent { ? `${child.props.title} (${child.props.list.length})` : child.props.title; return ( - + this.onItemClick(item, child.props)} - onClear={() => onClear(child.props.title)} + onClear={() => onClear(child.props.name)} title={child.props.title} locale={locale} /> diff --git a/src/components/NoticeIcon/index.zh-CN.md b/src/components/NoticeIcon/index.zh-CN.md index e5d96c85f42586d6fc8035a6407fe4813ed20121..056e376898b24443331dd70852d66d5cdcc55cf5 100644 --- a/src/components/NoticeIcon/index.zh-CN.md +++ b/src/components/NoticeIcon/index.zh-CN.md @@ -14,7 +14,7 @@ order: 9 count | 图标上的消息总数 | number | - bell | translate this please -> Change the bell Icon | ReactNode | `` loading | 弹出卡片加载状态 | boolean | false -onClear | 点击清空按钮的回调 | function(tabTitle) | - +onClear | 点击清空按钮的回调 | function(tabName) | - onItemClick | 点击列表项的回调 | function(item, tabProps) | - onTabChange | 切换页签的回调 | function(tabTitle) | - popupAlign | 弹出卡片的位置配置 | Object [alignConfig](https://github.com/yiminghe/dom-align#alignconfig-object-details) | - @@ -27,6 +27,7 @@ locale | 默认文案 | Object | `{ emptyText: '暂无数据', clear: '清空' } 参数 | 说明 | 类型 | 默认值 ----|------|-----|------ title | 消息分类的页签标题 | string | - +name | 消息分类的标识符 | string | - list | 列表数据,格式参照下表 | Array | `[]` showClear | 是否显示清空按钮 | boolean | true emptyText | 针对每个 Tab 定制空数据文案 | ReactNode | -