chore(加载主题样式): 只使用异步方式,保留一个函数loadTheme
This commit is contained in:
5
App.vue
5
App.vue
@@ -8,7 +8,7 @@
|
||||
|
||||
export default {
|
||||
mixins: [auth],
|
||||
onLaunch: function(options) {
|
||||
onLaunch: async function(options) {
|
||||
// 方式:支持快应用,从url中query部分获取uniacid,或useragent中获取uniacid
|
||||
if(options.query.uniacid){
|
||||
uni.setStorageSync('uniacid', options.query.uniacid);
|
||||
@@ -61,7 +61,8 @@
|
||||
|
||||
// 主题风格
|
||||
if (uni.getStorageSync('themeStyle')) {
|
||||
this.$store.commit('setThemeStyle', configExternal.loadThemeSync(uni.getStorageSync('themeStyle')));
|
||||
const themeData = await configExternal.loadTheme(uni.getStorageSync('themeStyle'));
|
||||
this.$store.commit('setThemeStyle', themeData);
|
||||
this.$store.dispatch('themeColorSet');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user