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 ? {
paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px'
} : {};
},
hasParentSubmenu () {
return findComponentUpward(this, 'Submenu');
}
},
methods: {

View file

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

View file

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