App.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <div id="app">
  3. <router-view></router-view>
  4. <xk-modal></xk-modal>
  5. <div class="dmp-alert" v-if="popupsList.length !== 0">
  6. <div class="dmp-alert-body" v-for="item in popupsList" :key="item.id">
  7. <alert-modal :params="item"></alert-modal>
  8. </div>
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'App',
  15. computed: {
  16. popupsList() {
  17. return this.$store.getters.getPopups;
  18. }
  19. },
  20. created() {
  21. // 获取滚动条的满宽度和高度
  22. const $dom = document.createElement('div');
  23. $dom.setAttribute('style', 'width: 100px; height:100px;overflow:scroll;position:absolute;top: -200px; left: -200px');
  24. document.body.appendChild($dom);
  25. window.scrollBarWidth = $dom.offsetWidth - $dom.clientWidth;
  26. window.scrollBarHeight = $dom.offsetHeight - $dom.clientHeight;
  27. document.body.removeChild($dom);
  28. }
  29. };
  30. </script>
  31. <style>
  32. @import './assets/css/main.scss';
  33. </style>