Commit 750db02a authored by Sendya's avatar Sendya

fix: openKeys deep error vueComponent/ant-design-vue-pro/issues/1271

parent dd1a6886
{
"name": "@ant-design-vue/pro-layout",
"version": "1.0.9",
"version": "1.0.10",
"main": "./lib/index.js",
"module": "./es/index.js",
"repository": {
......
......@@ -101,12 +101,8 @@ const RouteMenu = {
this.sOpenKeys = openKeys
return
}
const latestOpenKey = openKeys.find(key => !this.sOpenKeys.includes(key))
if (!openOnceKey) {
this.sOpenKeys = openKeys
} else {
this.sOpenKeys = latestOpenKey ? [latestOpenKey] : []
}
// const latestOpenKey = openKeys.find(key => !this.sOpenKeys.includes(key))
this.sOpenKeys = openKeys
this.$emit('openChange', openKeys)
}
......@@ -156,8 +152,10 @@ const RouteMenu = {
})
}
if (!this.openOnceKey) {
this.sOpenKeys.forEach(item => openKeys.push(item))
}
this.sOpenKeys.forEach(item => {
openKeys.push(item)
})
}
this.collapsed ? (this.cachedOpenKeys = openKeys) : (this.sOpenKeys = openKeys)
}
......@@ -174,7 +172,7 @@ const RouteMenu = {
})
this.$watch('collapsed', val => {
if (val) {
this.cachedOpenKeys = this.openKeys.concat()
this.cachedOpenKeys = this.sOpenKeys.concat()
this.sOpenKeys = []
} else {
this.sOpenKeys = this.cachedOpenKeys
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment