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