home-bg.vue 574 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <div class="hc-login-theme-home" v-if="isBody">
  3. <template v-for="item in theme.home">
  4. <img :src="item.bg" :alt="item.name" loading="lazy">
  5. </template>
  6. </div>
  7. </template>
  8. <script setup>
  9. import {ref, nextTick} from "vue";
  10. import theme from '~src/config/theme'
  11. const isBody = ref(false)
  12. //渲染完成
  13. nextTick(()=> {
  14. isBody.value = true
  15. })
  16. </script>
  17. <style lang="scss" scoped>
  18. //预先加载首页背景图
  19. .hc-login-theme-home {
  20. position: absolute;
  21. z-index: -11;
  22. img {
  23. width: 100px;
  24. }
  25. }
  26. </style>