Skip to content

Commit 521b645

Browse files
committed
fix: account submenu select #276
1 parent e388d31 commit 521b645

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/views/account/settings/Index.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a-menu
77
:mode="device == 'mobile' ? 'horizontal' : 'inline'"
88
:style="{ border: '0', width: device == 'mobile' ? '560px' : 'auto'}"
9-
:defaultSelectedKeys="defaultSelectedKeys"
9+
:selectedKeys="selectedKeys"
1010
type="inner"
1111
@openChange="onOpenChange"
1212
>
@@ -64,7 +64,7 @@ export default {
6464
mode: 'inline',
6565
6666
openKeys: [],
67-
defaultSelectedKeys: [],
67+
selectedKeys: [],
6868
6969
// cropper
7070
preview: {},
@@ -96,7 +96,12 @@ export default {
9696
},
9797
updateMenu () {
9898
const routes = this.$route.matched.concat()
99-
this.defaultSelectedKeys = [ routes.pop().path ]
99+
this.selectedKeys = [ routes.pop().path ]
100+
}
101+
},
102+
watch: {
103+
'$route' (val) {
104+
this.updateMenu()
100105
}
101106
}
102107
}

vue.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ module.exports = {
3333
matchColors: getAntdSerials('#1890ff'), // 主色系列
3434
// 改变样式选择器,解决样式覆盖问题
3535
changeSelector (selector) {
36-
console.log(selector)
3736
switch (selector) {
3837
case '.ant-calendar-today .ant-calendar-date':
3938
return ':not(.ant-calendar-selected-date)' + selector

0 commit comments

Comments
 (0)