fix: openKeys

This commit is contained in:
FairyEver 2022-02-19 16:03:24 +08:00
parent 9d80e3e14a
commit 3f79f2f289
1 changed files with 5 additions and 2 deletions

View File

@ -16,7 +16,7 @@
</template>
<script>
import { computed } from 'vue'
import { computed, unref } from 'vue'
import { useRoute } from 'vue-router'
import { useCssVar } from '@vueuse/core'
import { compact } from 'lodash-es'
@ -51,7 +51,10 @@ export default {
const selectedKeys = computed(() => compact([selectedKey.value]))
const openKeys = computed(() => getMenuPids(selectedKey.value))
const openKeys = computed(() => {
if (unref(collapsed)) return []
return getMenuPids(selectedKey.value)
})
const inlineIndent = computed(() => {
// Keep the same calculation rules as in CSS