From a21e798b8f321c6c6c107541b795879d20c22b75 Mon Sep 17 00:00:00 2001 From: zhigang.li Date: Fri, 19 Jan 2018 15:59:37 +0800 Subject: [PATCH] udpate --- src/components/menu/menu-item.vue | 3 --- src/components/menu/mixin.js | 5 ++++- src/components/menu/submenu.vue | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/menu/menu-item.vue b/src/components/menu/menu-item.vue index d4fdce9..074192b 100644 --- a/src/components/menu/menu-item.vue +++ b/src/components/menu/menu-item.vue @@ -40,9 +40,6 @@ return this.hasParentSubmenu ? { paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px' } : {}; - }, - hasParentSubmenu () { - return findComponentUpward(this, 'Submenu'); } }, methods: { diff --git a/src/components/menu/mixin.js b/src/components/menu/mixin.js index d6374bf..3d49761 100644 --- a/src/components/menu/mixin.js +++ b/src/components/menu/mixin.js @@ -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; } diff --git a/src/components/menu/submenu.vue b/src/components/menu/submenu.vue index cd4255e..d010450 100644 --- a/src/components/menu/submenu.vue +++ b/src/components/menu/submenu.vue @@ -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' -- libgit2 0.21.4