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
61
62
<template>
<van-config-provider :theme-vars="themeVars">
<div class="h-full resident-home">
<router-view v-slot="{ Component }">
<Transition name="route" mode="out-in">
<component :is="Component" v-if="visible"/>
</Transition>
</router-view>
</div>
</van-config-provider>
</template>
<script>
import { getDict } from '@/api/base.js'
import { useStore } from './store/index.js'
export default {
data() {
return {
visible: false,
themeVars: {
primaryColor: '#54CCBD',
// 按键
buttonPrimaryBackground: '#54CCBD',
buttonPrimaryBorderColor: '#54CCBD',
buttonDefaultBorderColor: '#BFBFBF',
buttonNormalFontSize: '.16rem',
pickerConfirmActionColor: '#54CCBD',
checkboxCheckedIconColor: '#54CCBD',
// tab
tabsBottomBarColor: '#54CCBD',
// 级联选项
cascaderActiveColor: '#54CCBD',
// 表单相关
cellVerticalPadding: '.15rem',
cellTextColor: '#262626',
fieldLabelColor: '#262626',
cellBorderColor: '#d9d9d9'
}
}
},
setup() {
const store = useStore()
return { store }
},
created() {
this.init()
},
methods: {
async init() {
console.log(this.visible)
const res = await getDict()
this.store.$patch({ dict: res.data || {} })
this.visible = true
}
}
}
</script>
<style lang="less" scoped>
</style>