Blame view

src/components/menu/menu-group.vue 849 Bytes
8778b343   梁灏   init Menu components
1
  <template>
e05d7289   梁灏   update Menu
2
      <li :class="[prefixCls + '-item-group']">
3e3fba0e   zhigang.li   add style for men...
3
          <div :class="[prefixCls + '-item-group-title']" :style="groupStyle">{{ title }}</div>
e05d7289   梁灏   update Menu
4
5
          <ul><slot></slot></ul>
      </li>
8778b343   梁灏   init Menu components
6
7
  </template>
  <script>
6b4e7383   zhigang.li   update menu-group
8
      import mixin from './mixin';
e05d7289   梁灏   update Menu
9
10
      const prefixCls = 'ivu-menu';
  
8778b343   梁灏   init Menu components
11
      export default {
e05d7289   梁灏   update Menu
12
          name: 'MenuGroup',
6b4e7383   zhigang.li   update menu-group
13
          mixins: [ mixin ],
e05d7289   梁灏   update Menu
14
15
16
17
18
19
          props: {
              title: {
                  type: String,
                  default: ''
              }
          },
8778b343   梁灏   init Menu components
20
          data () {
e05d7289   梁灏   update Menu
21
22
              return {
                  prefixCls: prefixCls
b0893113   jingsam   :art: add eslint
23
              };
3e3fba0e   zhigang.li   add style for men...
24
25
          },
          computed: {
3e3fba0e   zhigang.li   add style for men...
26
              groupStyle () {
b2d676bd   zhigang.li   fixed the bug abo...
27
                  return this.hasParentSubmenu && this.mode !== 'horizontal' ? {
3e3fba0e   zhigang.li   add style for men...
28
29
30
                      paddingLeft: 43 + (this.parentSubmenuNum - 1) * 28 + 'px'
                  } : {};
              }
e05d7289   梁灏   update Menu
31
          }
b0893113   jingsam   :art: add eslint
32
33
      };
  </script>