Blame view

HHECS.Web/src/layout/components/Sidebar/FixiOSBug.js 633 Bytes
胡菁 authored
1
2
3
export default {
  computed: {
    device() {
胡菁 authored
4
5
      return this.$store.state.app.device
    }
胡菁 authored
6
7
8
9
  },
  mounted() {
    // In order to fix the click on menu on the ios device will trigger the mouseleave bug
    // https://github.com/PanJiaChen/vue-element-admin/issues/1135
胡菁 authored
10
    this.fixBugIniOS()
胡菁 authored
11
12
13
  },
  methods: {
    fixBugIniOS() {
胡菁 authored
14
      const $subMenu = this.$refs.subMenu
胡菁 authored
15
      if ($subMenu) {
胡菁 authored
16
        const handleMouseleave = $subMenu.handleMouseleave
胡菁 authored
17
        $subMenu.handleMouseleave = (e) => {
胡菁 authored
18
19
          if (this.device === 'mobile') {
            return
胡菁 authored
20
          }
胡菁 authored
21
22
          handleMouseleave(e)
        }
胡菁 authored
23
      }
胡菁 authored
24
25
26
    }
  }
}