diff --git a/components/dropdown/demo/basic.md b/components/dropdown/demo/basic.md index 12f3c65d9c..7286e9946e 100644 --- a/components/dropdown/demo/basic.md +++ b/components/dropdown/demo/basic.md @@ -34,6 +34,7 @@ const menu = ( 3rd menu item + a danger item ); diff --git a/components/dropdown/style/index.less b/components/dropdown/style/index.less index 182d038ce4..5facb15605 100644 --- a/components/dropdown/style/index.less +++ b/components/dropdown/style/index.less @@ -1,5 +1,6 @@ @import '../../style/themes/index'; @import '../../style/mixins/index'; +@import './status'; @dropdown-prefix-cls: ~'@{ant-prefix}-dropdown'; diff --git a/components/dropdown/style/status.less b/components/dropdown/style/status.less new file mode 100644 index 0000000000..327cf488ab --- /dev/null +++ b/components/dropdown/style/status.less @@ -0,0 +1,12 @@ +@import './index'; + +.@{dropdown-prefix-cls}-menu-item { + &&-danger { + color: @error-color; + + &:hover { + color: @text-color-inverse; + background-color: @error-color; + } + } +} diff --git a/components/menu/MenuItem.tsx b/components/menu/MenuItem.tsx index 89264afaad..89038863ca 100644 --- a/components/menu/MenuItem.tsx +++ b/components/menu/MenuItem.tsx @@ -16,6 +16,7 @@ export interface MenuItemProps disabled?: boolean; level?: number; icon?: React.ReactNode; + danger?: boolean; title?: React.ReactNode; children?: React.ReactNode; className?: string; @@ -50,7 +51,7 @@ export default class MenuItem extends React.Component { renderItem = ({ siderCollapsed }: SiderContextProps) => { const { level, className, children, rootPrefixCls } = this.props; - const { title, icon, ...rest } = this.props; + const { title, icon, danger, ...rest } = this.props; return ( @@ -81,6 +82,7 @@ export default class MenuItem extends React.Component {