Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复sys_theme被覆盖问题 #38

Merged
merged 1 commit into from
Mar 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
修复sys_theme被覆盖问题
问题复现步骤:
①在config/ColorUI.js配置config.theme为light,此时主题为light
②通过ui-change-theme把主题切换为dark,此时主题为dark
③刷新一下页面,storage的sys_theme被覆盖为light,$cuConfig.theme为dark
④再次刷新一下页面,storage的sys_theme为light,$cuConfig.theme为light
  • Loading branch information
qywk99 authored Mar 13, 2023
commit 08d51e5416d240e0bee9b859074af1c60775de0c
4 changes: 2 additions & 2 deletions mp-cu/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ export default class ColorUI {
setStatusStyle(wx.getSystemInfoSync().theme === 'light' ? 'dark' : 'light')
})
} else {
wx.setStorageSync('sys_theme', this.config.theme)
setStatusStyle(this.config.theme === 'light' ? 'dark' : 'light');
wx.setStorageSync('sys_theme', store.state.sys_theme)
setStatusStyle(store.state.sys_theme === 'light' ? 'dark' : 'light');
}
const originPage = Page
const originComponent = Component;
Expand Down