Skip to content

Commit

Permalink
fix(Menu): 默认展开Icon箭头方向错误 #712 (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
nullptr-z authored Mar 28, 2022
1 parent a61a0d9 commit 3b3bc7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/react-menu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ ReactDOM.render(<Demo />, _mount_);
| inlineIndent | 菜单缩进宽度 | Number | `10` |
| theme | 主题颜色 | Enum{`light`, `dark`} | - |
| bordered | 是否有边框 | Boolean | `false` |
| inlineCollapsed | 菜单是否收起状态 | Boolean | `false` |


## Menu.Item.Props
Expand All @@ -535,7 +536,6 @@ ReactDOM.render(<Demo />, _mount_);
| ~~isSubMenuItem~~ | 不可用,SubMenu 组件传递给 Item 组件的**标记**属性,这是一个内部参数。 | Boolean | - |
| tagName | 设置子节点标签名,默认 `<a />` 标签,也可以指定路由 [`<Link />`](https://reacttraining.com/react-router/web/api/Link) | String | `a` |
| active | 激活选中状态 | Boolean | `false` |
| inlineCollapsed | 菜单是否收起状态 | Boolean | `false` |
| disabled | 禁用状态 | Boolean | `false` |

其它参数可根据 `tagName` 来设置,默认 `<a />` 标签时,可设置 `href="https://wwww.google.com"` 或者 `target="_blank"` 等参数,你可以设置 [react-router-dom](https://github.com/ReactTraining/react-router) 路由 `<Link>`,例如:
Expand Down
4 changes: 2 additions & 2 deletions packages/react-menu/src/SubMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export const SubMenu = React.forwardRef(function <Tag extends TagType = 'a'>(
className: [prefixCls ? `${prefixCls}-overlay` : null].filter(Boolean).join(' ').trim(),
};
const popupRef = React.useRef<OverlayTriggerRef>(null);
const [isOpen, setIsOpen] = useState(false);
const [isOpen, setIsOpen] = useState(!!overlayProps.isOpen);
useMemo(() => {
setIsOpen(false);
if (collapse) setIsOpen(false);
}, [collapse]);

function onClick(e: React.MouseEvent<HTMLUListElement, MouseEvent>) {
Expand Down

0 comments on commit 3b3bc7b

Please sign in to comment.