home.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <div class="layout">
  3. <Header class="header" />
  4. <div class="container">
  5. <Slide class="slide" />
  6. <div class="content" ref="drawEle">
  7. <Renderer v-if="drawEle" ref="draw" />
  8. </div>
  9. </div>
  10. </div>
  11. </template>
  12. <script lang="ts" setup>
  13. import { Header } from "./header/";
  14. import { ref } from "vue";
  15. import { Slide } from "./slide";
  16. import { DrawExpose, Renderer } from "@/index.ts";
  17. import { installDraw } from "./use-draw.ts";
  18. const drawEle = ref<HTMLDivElement | null>(null);
  19. const draw = ref<DrawExpose>();
  20. installDraw(draw);
  21. </script>
  22. <style lang="scss" scoped>
  23. @use '../styles/global';
  24. .layout {
  25. display: flex;
  26. flex-direction: column;
  27. align-items: stretch;
  28. height: 100vh;
  29. background: #f0f2f5;
  30. .header {
  31. height: global.$headerSize;
  32. }
  33. .container {
  34. position: relative;
  35. width: 100%;
  36. height: calc(100% - #{global.$headerSize});
  37. }
  38. .slide {
  39. position: absolute;
  40. left: 0;
  41. width: global.$slideSize;
  42. overflow-y: auto;
  43. height: 100%;
  44. top: 0;
  45. background: #fff;
  46. z-index: 1;
  47. }
  48. .content {
  49. position: absolute;
  50. inset: 0;
  51. }
  52. }
  53. </style>