FixedScreenLayout.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <div class="fixed-screen-wrapper">
  3. <div id="init-box" class="init-box">
  4. <Nav :usePx="true" />
  5. <router-view />
  6. </div>
  7. <CustomNotice />
  8. </div>
  9. </template>
  10. <script setup lang="ts">
  11. import { onMounted, onUnmounted } from 'vue';
  12. import { storeToRefs } from 'pinia';
  13. import usePageSizeStore from '@/hooks/usePageSizeStore';
  14. import Nav from '@/components/Nav.vue';
  15. import useViolationNoticeStore from '@/views/institute-safety/modules/safety-company-home/stores/use-violation-notice-store';
  16. import CustomNotice from '@/components/custom-notivue/index.vue';
  17. useViolationNoticeStore();
  18. const pageSize = usePageSizeStore();
  19. const { ratio, rotate } = storeToRefs(pageSize);
  20. const { computePageSize } = pageSize;
  21. onMounted(() => {
  22. computePageSize();
  23. window.addEventListener('resize', computePageSize);
  24. });
  25. onUnmounted(() => {
  26. window.removeEventListener('resize', computePageSize);
  27. });
  28. </script>
  29. <style scoped lang="scss">
  30. .fixed-screen-wrapper {
  31. position: relative;
  32. overflow: hidden;
  33. flex-shrink: 0;
  34. transform: scale(v-bind('ratio')) rotate(v-bind(rotate));
  35. }
  36. .init-box {
  37. position: relative;
  38. width: 1920px;
  39. height: 1080px;
  40. background-color: #e7f1ff;
  41. overflow: hidden;
  42. }
  43. </style>