Files
mini-yu/uni_modules/tdesign-uniapp/components/mixins/theme-change.js

17 lines
316 B
JavaScript
Raw Normal View History

2026-02-10 08:05:03 +08:00
import { appBaseInfo } from '../common/utils';
export const themeMixin = {
data() {
return {
theme: 'light',
};
},
mounted() {
this.theme = appBaseInfo.theme;
if (typeof uni.onThemeChange !== 'function') return;
uni.onThemeChange((t) => {
this.theme = t.theme;
});
},
};