Blame view

src/components/mew-menu/mixin.js 501 Bytes
b9851cf0   chenhaodong   mew-menu
1
2
3
4
  import { findComponentUpward, findComponentsUpward } from '../../utils/assist';
  export default {
      data () {
          return {
7b487076   chenhaodong   fix
5
              menu: findComponentUpward(this, 'MewMenu')
b9851cf0   chenhaodong   mew-menu
6
7
8
9
          };
      },
      computed: {
          hasParentSubmenu () {
7b487076   chenhaodong   fix
10
              return !!findComponentUpward(this, 'MewSubmenu');
b9851cf0   chenhaodong   mew-menu
11
12
          },
          parentSubmenuNum () {
7b487076   chenhaodong   fix
13
              return findComponentsUpward(this, 'MewSubmenu').length;
b9851cf0   chenhaodong   mew-menu
14
15
16
17
18
19
          },
          mode () {
              return this.menu.mode;
          }
      }
  };