need-miniprogram-ui
Version:
小程序UI组件库
1 lines • 568 B
JavaScript
Object.defineProperty(exports,"__esModule",{value:!0});var __instance=void 0,InsideDarkmode=(()=>{function e(e){var n=this,e=(this.callbacks=[e||{}],wx.getAppBaseInfo());this.current=e&&e.theme?e.theme:"light",this.change(this.current),wx.onThemeChange(function(e){n.change(e.theme)})}return e.prototype.change=function(n){this.current=n,this.callbacks.forEach(function(e){e.onChange&&e.onChange(n)})},e})(),DarkMode=function(e){__instance?(__instance.callbacks.push(e),__instance.change(__instance.current)):__instance=new InsideDarkmode(e)};exports.default=DarkMode;