This commit is contained in:
zhigang.li 2018-01-19 15:59:37 +08:00
parent acba45fed5
commit a21e798b8f
3 changed files with 4 additions and 7 deletions

View file

@ -40,9 +40,6 @@
return this.hasParentSubmenu ? { return this.hasParentSubmenu ? {
paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px' paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px'
} : {}; } : {};
},
hasParentSubmenu () {
return findComponentUpward(this, 'Submenu');
} }
}, },
methods: { methods: {

View file

@ -1,6 +1,9 @@
import { findComponentsUpward } from '../../utils/assist'; import { hasParentSubmenu, findComponentUpward, findComponentsUpward } from '../../utils/assist';
export default { export default {
computed: { computed: {
hasParentSubmenu () {
return findComponentUpward(this, 'Submenu');
},
parentSubmenuNum () { parentSubmenuNum () {
return findComponentsUpward(this, 'Submenu').length; return findComponentsUpward(this, 'Submenu').length;
} }

View file

@ -75,9 +75,6 @@
if (this.dropWidth) style.minWidth = `${this.dropWidth}px`; if (this.dropWidth) style.minWidth = `${this.dropWidth}px`;
return style; return style;
}, },
hasParentSubmenu () {
return findComponentUpward(this, 'Submenu');
},
titleStyle () { titleStyle () {
return this.hasParentSubmenu ? { return this.hasParentSubmenu ? {
paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px' paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px'