Commit a21e798b8f321c6c6c107541b795879d20c22b75

Authored by zhigang.li
1 parent acba45fe

udpate

src/components/menu/menu-item.vue
... ... @@ -40,9 +40,6 @@
40 40 return this.hasParentSubmenu ? {
41 41 paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px'
42 42 } : {};
43   - },
44   - hasParentSubmenu () {
45   - return findComponentUpward(this, 'Submenu');
46 43 }
47 44 },
48 45 methods: {
... ...
src/components/menu/mixin.js
1   -import { findComponentsUpward } from '../../utils/assist';
  1 +import { hasParentSubmenu, findComponentUpward, findComponentsUpward } from '../../utils/assist';
2 2 export default {
3 3 computed: {
  4 + hasParentSubmenu () {
  5 + return findComponentUpward(this, 'Submenu');
  6 + },
4 7 parentSubmenuNum () {
5 8 return findComponentsUpward(this, 'Submenu').length;
6 9 }
... ...
src/components/menu/submenu.vue
... ... @@ -75,9 +75,6 @@
75 75 if (this.dropWidth) style.minWidth = `${this.dropWidth}px`;
76 76 return style;
77 77 },
78   - hasParentSubmenu () {
79   - return findComponentUpward(this, 'Submenu');
80   - },
81 78 titleStyle () {
82 79 return this.hasParentSubmenu ? {
83 80 paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px'
... ...