Skip to content

Commit 70fc8e3

Browse files
committed
fix: fix darkmode
1 parent e897760 commit 70fc8e3

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Diff for: mpflow.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ module.exports = {
4545
useIsolateContext: true,
4646
useCompilerModule: false,
4747
userConfirmedUseCompilerModuleSwitch: false,
48-
compileWorklet: true
48+
compileWorklet: true,
49+
minifyWXSS: false
4950
}
5051
}

Diff for: src/app.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ const themeListeners = []
33
App({
44
onLaunch: function () {
55
console.log('App Launch')
6+
wx.onThemeChange(({ theme }) => {
7+
this.themeChanged(theme)
8+
})
69
},
710
onShow: function () {
811
console.log('App Show')
@@ -29,7 +32,7 @@ App({
2932
},
3033
globalData: {
3134
hasLogin: false,
32-
theme: 'light',
35+
theme: wx.getAppBaseInfo().theme,
3336
GRID_DEMO_URL: '/example/index',
3437
iconTabbar: require('/example/images/icon_tabbar.png').default
3538
}

Diff for: src/app.json

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
},
5656
"debug": true,
5757
"style": "v2",
58+
"darkmode": true,
5859
"lazyCodeLoading": "requiredComponents",
5960
"renderer": "skyline",
6061
"rendererOptions": {

0 commit comments

Comments
 (0)