Skip to content

Commit 7ed769e

Browse files
committed
fix: modify review code
1 parent 8242544 commit 7ed769e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/sites/src/views/layout/layout.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,11 @@ export default defineComponent({
134134
(currentVal) => {
135135
// 监听路由变化,反作用与左侧列表菜单展开对应的列表
136136
const list = currentVal.split('/')
137-
const key = list[list.length - 1]
138-
state.expandKeys = [key]
139-
state.treeMenuRef.setCurrentKey(key)
137+
if (list && list[list.length - 1]) {
138+
const key = list[list.length - 1]
139+
state.expandKeys = [key]
140+
state.treeMenuRef.setCurrentKey(key)
141+
}
140142
}
141143
)
142144

0 commit comments

Comments
 (0)