App.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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 id="container"></div>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. name: 'App',
  16. computed: {
  17. popupsList() {
  18. return this.$store.getters.getPopups;
  19. }
  20. },
  21. created() {
  22. // 获取滚动条的满宽度和高度
  23. const $dom = document.createElement('div');
  24. $dom.setAttribute('style', 'width: 100px; height:100px;overflow:scroll;position:absolute;top: -200px; left: -200px');
  25. document.body.appendChild($dom);
  26. window.scrollBarWidth = $dom.offsetWidth - $dom.clientWidth;
  27. window.scrollBarHeight = $dom.offsetHeight - $dom.clientHeight;
  28. document.body.removeChild($dom);
  29. }
  30. };
  31. </script>
  32. <style>
  33. @import './assets/css/main.scss';
  34. </style>