<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: '16px',
                // 表单相关
                cellVerticalPadding: '15px',
                cellTextColor: '#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>
