App.vue
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!--
* @Descripttion:
* @version: 0.0.0
* @Author: genglw
* @Date: 2022-01-29 16:40:40
* @LastEditors: genglw
* @LastEditTime: 2022-02-18 14:06:28
-->
<template>
<view :style="vuex_theme">
<u-toast ref="uToast" />
</view>
</template>
<script>
import {themeList} from './common/theme.js'
export default {
// 此处globalData为了演示其作用,不是uView框架的一部分
globalData: {
username: ''
},
data() {
return {
themeList,
}
},
onLaunch() {
let colorObj = this.themeList[this.vuex_appId].value
let styles = ''
for (let i in colorObj) {
styles += colorObj[i].name + ':' + colorObj[i].value + ';'
}
this.$u.vuex('vuex_theme', styles);
this.$u.vuex('vuex_baseImgUrl', this.themeList[this.vuex_appId].imagePath);
// console.log('vuex_theme----', this.vuex_theme)
uni.setTabBarStyle({
selectedColor: this.themeList[this.vuex_appId].mainColor,
})
},
onShow() {
console.log("App onshow")
},
methods: {
},
}
</script>
<style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import "@/uni_modules/uview-ui/index.scss";
@import '@/static/css/icon.css';
</style>