# wx.onThemeChange(function callback)
Start from base library version 2.11.0. Please remaining backward compatible.
with Promise style call: Not supported
Mini Program plugin: Not supported
Listen for system theme change events. This event is related to ApageonThemeChange
The timing of the pullback was consistent.
# parameter
# function callback
Callback function for system theme change event
# parameter
# Object res
attribute | type | Introductions |
---|---|---|
theme | string | The current theme of the system, with a value oflight ordark |
theme Legal value
value | Introductions | Minimum version |
---|---|---|
dark | Dark theme | |
light | Light color theme |
# Be careful
- Only configure "dark mode" globally: This event is triggered when true.