App.vue 682 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <div id="app" :style="{ backgroundImage: `url(${backgroundImg})` }">
  3. <Nav />
  4. <router-view />
  5. </div>
  6. </template>
  7. <script setup lang="ts">
  8. import { computed } from 'vue';
  9. import { useRoute } from 'vue-router';
  10. import Nav from '@/components/Nav.vue';
  11. const route = useRoute();
  12. const backgroundImg = computed(() => {
  13. return route.path === '/home' ? '/src/assets/images/home/home-bg@1X.png' : '';
  14. });
  15. </script>
  16. <style scoped lang="scss">
  17. #app {
  18. display: flex;
  19. flex-direction: column;
  20. width: 100vw;
  21. height: 100vh;
  22. background-position: center center;
  23. background-repeat: no-repeat;
  24. background-size: cover;
  25. }
  26. </style>