<template>
    <div class="scroll-wrapper" ref="scroll">
        <app-bar ref="bar"></app-bar>
        <router-view class="scroll-content" ref="content" />
    </div>
</template>

<script>
import AppBar from './components/AppBar.vue';
import { computed } from 'vue';
export default {
    components: { AppBar },
    name: 'App',
    provide() {
        return {
            setKeeps: this.setKeeps,
            bar: computed(() => this.$refs.bar),
            content: computed(() => this.$refs.content)
        };
    },
    data() {
        return {
            checkEvent: null,
            keeps: []
        };
    },
    watch: {
        $route() {
            this.$nextTick(() => {
                this.$el.scrollTop = 0;
            });
        }
    },
    mounted() {
        // this.$dialog
        //     .confirm({
        //         title: '提示',
        //         message: '您的藏品室有一个新资产哦！',
        //         confirmButtonText: '立即查看'
        //     })
        //     .then(() => {
        //         this.$router.push('/store');
        //     });
    },
    methods: {
        setKeeps(keeps) {
            this.keeps = keeps;
        }
    }
};
</script>

<style lang="less" scoped>
.scroll-content {
    min-height: 100vh;
    box-sizing: border-box;
    // padding-top: 46px;
}
.scroll-wrapper {
    background-color: @bg;
}
</style>
