17 lines
316 B
JavaScript
17 lines
316 B
JavaScript
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;
|
|
});
|
|
},
|
|
};
|