Skip to content

Commit d1392bd

Browse files
committed
fix(theme oldVal)
1 parent d5f7419 commit d1392bd

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/components/Navigation/MenuBar/index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
:default-active="getCurrentRoute"
1818
class="menubar-menu-list"
1919
:collapse="isCollapse"
20+
:collapse-transition="false"
2021
@select="handleMenuSelect"
2122
>
22-
<!-- :collapse-transition="false" -->
23-
<!-- :active-text-color="getActiveTextColor" -->
2423
<NavigationMenuBarItem
2524
v-for="(route, index) in getRoutes"
2625
:key="index"

src/components/ThemePicker/index.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export default {
3030
},
3131
immediate: true
3232
},
33-
async theme (val) {
34-
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
33+
async theme (val, prevVal) {
34+
const oldVal = prevVal || this.theme
3535
if (typeof val !== 'string') return
3636
const themeCluster = this.getThemeCluster(val.replace('#', ''))
3737
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
@@ -60,10 +60,10 @@ export default {
6060
}
6161
}
6262
63-
// if (!this.chalk) {
64-
const url = `https://unpkg.com/element-ui@${version}/lib/theme-chalk/index.css`
65-
await this.getCSSString(url, 'chalk')
66-
// }
63+
if (!this.chalk) {
64+
const url = `https://unpkg.com/element-ui@${version}/lib/theme-chalk/index.css`
65+
await this.getCSSString(url, 'chalk')
66+
}
6767
6868
const chalkHandler = getHandler('chalk', 'chalk-style')
6969

0 commit comments

Comments
 (0)