<template>
    <div id="app">
        <router-view></router-view>
        <xk-modal></xk-modal>
        <div class="dmp-alert" v-if="popupsList.length !== 0">
            <div class="dmp-alert-body" v-for="item in popupsList" :key="item.id">
                <alert-modal :params="item"></alert-modal>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: 'App',
    computed: {
        popupsList() {
            return this.$store.getters.getPopups;
        }
    },
    created() {
        // 获取滚动条的满宽度和高度
        const $dom = document.createElement('div');
        $dom.setAttribute('style', 'width: 100px; height:100px;overflow:scroll;position:absolute;top: -200px; left: -200px');
        document.body.appendChild($dom);
        window.scrollBarWidth = $dom.offsetWidth - $dom.clientWidth;
        window.scrollBarHeight = $dom.offsetHeight - $dom.clientHeight;
        document.body.removeChild($dom);
    }
};
</script>
<style>
@import './assets/css/main.scss';
</style>
