box.vue 703 B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <div
  3. class="box"
  4. :style="`width:${width}px;height:${height}px`"
  5. >
  6. <div class="box-top" />
  7. <div class="box-content">
  8. <slot />
  9. </div>
  10. </div>
  11. </template>
  12. <script setup lang='ts'>
  13. const props = defineProps<{
  14. width: number,
  15. height: number
  16. }>()
  17. </script>
  18. <style lang="scss" scoped>
  19. .box {
  20. width: 100%;
  21. height: 100%;
  22. background: linear-gradient(180deg, rgba(33, 133, 232, 0.0902) 0%, rgba(0, 170, 255, 0) 99%);
  23. &-top {
  24. background: url(../assets/img/1.png) no-repeat left center;
  25. width: 100%;
  26. height: 60px;
  27. background-size: contain;
  28. }
  29. }
  30. </style>