File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change
1
+ export default {
2
+ computed : {
3
+ device ( ) {
4
+ return this . $store . state . app . device
5
+ }
6
+ } ,
7
+ mounted ( ) {
8
+ // In order to fix the click on menu on the ios device will trigger the mouseeleave bug
9
+ // https://github.com/PanJiaChen/vue-element-admin/issues/1135
10
+ this . fixBugIniOS ( )
11
+ } ,
12
+ methods : {
13
+ fixBugIniOS ( ) {
14
+ const $submenu = this . $refs . submenu
15
+ if ( $submenu ) {
16
+ const handleMouseleave = $submenu . handleMouseleave
17
+ $submenu . handleMouseleave = ( e ) => {
18
+ if ( this . device === 'mobile' ) {
19
+ return
20
+ }
21
+ handleMouseleave ( e )
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
Original file line number Diff line number Diff line change 9
9
</app-link >
10
10
</template >
11
11
12
- <el-submenu v-else :index =" item.name||item.path" >
12
+ <el-submenu v-else ref = " submenu " :index =" item.name||item.path" >
13
13
<template slot="title">
14
14
<item v-if =" item.meta" :icon =" item.meta.icon" :title =" generateTitle(item.meta.title)" />
15
15
</template >
@@ -40,10 +40,12 @@ import { generateTitle } from '@/utils/i18n'
40
40
import { validateURL } from ' @/utils/validate'
41
41
import Item from ' ./Item'
42
42
import AppLink from ' ./Link'
43
+ import FixiOSBug from ' ./FixiOSBug'
43
44
44
45
export default {
45
46
name: ' SidebarItem' ,
46
47
components: { Item, AppLink },
48
+ mixins: [FixiOSBug],
47
49
props: {
48
50
// route object
49
51
item: {
You can’t perform that action at this time.
0 commit comments