BaseCard.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="card" :style="{ height: `${height}px` }">
  4. <p class="card_title">
  5. <slot name="title">{{ title }}</slot>
  6. </p>
  7. <div class="card_content" :style="{ height: `${contentHeight}px` }">
  8. <slot></slot>
  9. </div>
  10. </div>
  11. </template>
  12. <script lang="ts" setup>
  13. // import mapComponent from './components/3Dmap/index.vue';
  14. withDefaults(
  15. defineProps<{
  16. title: string;
  17. /** 卡片总体的高度 */
  18. height: number;
  19. /** 卡片内容部分的高度 */
  20. contentHeight: number;
  21. }>(),
  22. {
  23. height: 320,
  24. contentHeight: 250,
  25. }
  26. );
  27. </script>
  28. <style lang="less" scoped>
  29. @font-face {
  30. font-family: 'douyuFont';
  31. src: url('@/assets/font/douyuFont.otf');
  32. }
  33. .card {
  34. background: url('@/assets/images/company/area-card4.png') no-repeat;
  35. background-size: 100% 100%;
  36. padding: 2px 20px 0 20px;
  37. text-align: center;
  38. }
  39. .card_title {
  40. margin-top: 10px;
  41. font-family: 'douyuFont';
  42. }
  43. .card_content {
  44. }
  45. </style>