App.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <script setup lang="ts">
  2. // import HelloWorld from './components/HelloWorld.vue'
  3. import {onMounted, ref} from "vue";
  4. import MacWindow from "./components/window/macWindow.vue";
  5. import MagnetView from "./components/magnetView.vue";
  6. import AppleBar from "@/components/appleBar/appleBar.vue";
  7. import {NavItem} from "@/components/appleBar/appleBar.ts";
  8. onMounted(() => {
  9. });
  10. let navItems:NavItem[] = [
  11. {
  12. id: 1,
  13. name: '首页',
  14. actionCode: 'toHome',
  15. description: '返回首页',
  16. icon: 'system',
  17. },
  18. {
  19. id: 1,
  20. name: '首页',
  21. actionCode: 'toHome',
  22. description: '返回首页',
  23. icon: 'home',
  24. },
  25. {
  26. id: 1,
  27. name: '首页',
  28. actionCode: 'toHome',
  29. description: '返回首页',
  30. icon: 'setting',
  31. },
  32. ]
  33. const title = ref("fc-ele");
  34. const navAction = (actionCode:string) => {
  35. console.log(`action: ${actionCode}`);
  36. }
  37. </script>
  38. <template>
  39. <mac-window :title="title" :icon="'home'">
  40. <div class="image-bg">
  41. <img src="./assets/images/bg.jpg" alt="">
  42. </div>
  43. <div class="app-bar">
  44. <apple-bar
  45. :nav-items="navItems"
  46. :hide-time="3000"
  47. @action="navAction"
  48. ></apple-bar>
  49. </div>
  50. <div class="app-content">
  51. <magnet-view/>
  52. </div>
  53. </mac-window>
  54. </template>
  55. <style scoped>
  56. .app-content {
  57. width: 100%;
  58. height: 100%;
  59. background-color: var(--color-background-soft);
  60. overflow: auto;
  61. }
  62. .app-bar{
  63. width: 100%;
  64. height: 70px;
  65. display: flex;
  66. justify-content: center;
  67. position: absolute;
  68. left: 0;
  69. bottom: 0;
  70. z-index: 1000;
  71. }
  72. @media screen and (max-width: 768px) {
  73. .app-content {
  74. height: calc(100% - 50px);
  75. }
  76. .app-bar {
  77. position: relative;
  78. bottom: 0;
  79. }
  80. }
  81. </style>