DropDownButton 下拉按钮增加鼠标滑入滑出事件

This commit is contained in:
zhangxulong 2022-07-11 19:31:40 +08:00 committed by RUNZE LU
parent 01e1c1b2d6
commit ca9e7f8a55

View File

@ -179,7 +179,8 @@ export default class DropDownButton extends React.Component<
});
}
open() {
async open() {
await this.props.dispatchEvent('mouseenter', {data: this.props.buttons});
this.setState({
isOpened: true
});
@ -187,6 +188,7 @@ export default class DropDownButton extends React.Component<
close() {
this.timer = setTimeout(() => {
this.props.dispatchEvent('mouseleave', {data: this.props.buttons});
this.setState({
isOpened: false
});