Skip to content

Commit

Permalink
fix: modify review code
Browse files Browse the repository at this point in the history
  • Loading branch information
James-9696 committed Oct 16, 2024
1 parent 8242544 commit 7ed769e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/sites/src/views/layout/layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ export default defineComponent({
(currentVal) => {
// 监听路由变化,反作用与左侧列表菜单展开对应的列表
const list = currentVal.split('/')
const key = list[list.length - 1]
state.expandKeys = [key]
state.treeMenuRef.setCurrentKey(key)
if (list && list[list.length - 1]) {
const key = list[list.length - 1]
state.expandKeys = [key]
state.treeMenuRef.setCurrentKey(key)
}
}
)
Expand Down

0 comments on commit 7ed769e

Please sign in to comment.