-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:[Sidebar]: fixed bug in iOS (#1152)
- Loading branch information
1 parent
616f173
commit 935d9aa
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export default { | ||
computed: { | ||
device() { | ||
return this.$store.state.app.device | ||
} | ||
}, | ||
mounted() { | ||
// In order to fix the click on menu on the ios device will trigger the mouseeleave bug | ||
// https://github.com/PanJiaChen/vue-element-admin/issues/1135 | ||
this.fixBugIniOS() | ||
}, | ||
methods: { | ||
fixBugIniOS() { | ||
const $submenu = this.$refs.submenu | ||
if ($submenu) { | ||
const handleMouseleave = $submenu.handleMouseleave | ||
$submenu.handleMouseleave = (e) => { | ||
if (this.device === 'mobile') { | ||
return | ||
} | ||
handleMouseleave(e) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters