<template>
    <div id="app">
        <router-view v-if="isRouterAlive"></router-view>
    </div>
</template>
<script>
export default {
    data() {
        return {
            isRouterAlive: true
        };
    },
    methods: {
        //   inject: ['reload'],   在页面中注入此方法，  使用this.reload() 达到F5的效果
        reload() {
            this.isRouterAlive = false;
            this.$nextTick(function () {
                this.isRouterAlive = true;
            });
        }
    },
    provide() {
        return {
            reload: this.reload
        };
    },
    mounted() {
        const screenWidth = window.innerWidth
        let bodyStyle = document.body.style
        bodyStyle.transform = `scale(${screenWidth / 1920})`
       
        window.addEventListener('resize', () => {
            const screenWidth = window.innerWidth
            let bodyStyle = document.body.style
            bodyStyle.transform = `scale(${screenWidth / 1920})`
        })

        
    },
    beforeMount() {

    }
};
</script>
<style lang="less">
* {
    margin: 0;
    padding: 0;
}

body {
    width: 1920px;
    height: 1080px;
    position: fixed;
    left: 0;
    top: 0;
    overflow: hidden;
    background-color: #E7EFFC;
    transform-origin: left top;
}

</style>