long
2021-04-08 d8f5a1fcb8632a9fb51cac9d72fb3bacaa41cbc2
提交 | 用户 | age
2a61f6 1 export default {
L 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 mouseleave 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 }