diff --git a/packages/common/Menu/src/subMenu.vue b/packages/common/Menu/src/subMenu.vue
index ff04249be..17449e9be 100644
--- a/packages/common/Menu/src/subMenu.vue
+++ b/packages/common/Menu/src/subMenu.vue
@@ -20,7 +20,10 @@
{{ title }}
-
@@ -61,11 +64,6 @@ export default {
default: false
}
},
- data () {
- return {
- isCollapsed: true
- }
- },
computed: {
hasIcon () {
return this.NMenu.haIcon && this.$parent.$options.name === 'NMenu'
@@ -79,30 +77,17 @@ export default {
},
openNames () {
return this.NMenu.openNames || this.NMenu.defaultOpenNames
+ },
+ isCollapsed () {
+ return !this.openNames.includes(this.name)
}
},
- watch: {
- openNames (value) {
- this.setCollapsed()
- }
- },
- mounted () {
- this.setCollapsed()
- },
methods: {
handleClick () {
if (!this.disabled) {
- this.isCollapsed = !this.isCollapsed
this.NMenu.openKeysChangeCallback(this.name)
this.$emit('click', this)
}
- },
- setCollapsed () {
- if (this.openNames && this.openNames.includes(this.name)) {
- this.isCollapsed = false
- } else {
- this.isCollapsed = true
- }
}
}
}
diff --git a/styles/Menu.scss b/styles/Menu.scss
index ca96e393f..e5ed8d43a 100644
--- a/styles/Menu.scss
+++ b/styles/Menu.scss
@@ -57,7 +57,7 @@ $layout-nav-height: 64px;
top: 0;
bottom: 0;
z-index: 0;
- transition: opacity 0.3s $--n-ease-in-out-cubic-bezier;
+ transition: opacity 0.3s $--n-ease-in-out-cubic-bezier, background-position .3s $--n-ease-in-out-cubic-bezier;
opacity: 0;
}
@include m(selected) {
@@ -132,7 +132,6 @@ $layout-nav-height: 64px;
padding: 0;
@include fade-in-height-expand-transition();
}
-
}
@include b(menu-item-group) {
@include b(menu-item-group-title) {