BaseCard.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <script setup lang="ts">
  2. import { withDefaults } from 'vue';
  3. import type { CSSProperties } from 'vue'
  4. interface Props {
  5. cardWrapperStyle?: CSSProperties,
  6. title?: string,
  7. isText?: boolean,
  8. subTitle?: string,
  9. langKey?: string,
  10. subLangKey?: string
  11. }
  12. withDefaults(defineProps<Props>(),{
  13. cardWrapperStyle: () => ({}),
  14. isText: () => false,
  15. langKey: () => 'empty',
  16. subLangKey: () => 'empty'
  17. })
  18. </script>
  19. <template>
  20. <div class="layout-container " :style="cardWrapperStyle">
  21. <div class="layout-main px-[10px] md:px-[0px]">
  22. <h4 :class="['layout-title',isText ? 'pb-[18px]' : 'pb-[48px]', 'text-[28px]', 'md:text-[32px]']" v-if="!!title">{{ $t(langKey) }}</h4>
  23. <p v-if="subTitle" class="sub-title pb-[48px]">{{ $t(subLangKey) }}</p>
  24. <slot></slot>
  25. </div>
  26. </div>
  27. </template>
  28. <style scoped lang="scss">
  29. .layout-container {
  30. padding: 88px 0;
  31. .layout-main {
  32. max-width: 1080px;
  33. margin: 0 auto;
  34. .layout-title {
  35. font-size: 32px;
  36. line-height: 44px;
  37. font-weight: bold;
  38. text-align: center;
  39. color: $t-color-primary;
  40. }
  41. .sub-title {
  42. font-size: 18px;
  43. line-height: 26px;
  44. text-align: center;
  45. color: #666666;
  46. }
  47. }
  48. }
  49. @media screen and (max-width: 944px){
  50. .en{
  51. .layout-container{
  52. .layout-main{
  53. .layout-title{
  54. font-size: 26px !important;
  55. }
  56. }
  57. }
  58. }
  59. }
  60. .en{
  61. .layout-container{
  62. .layout-main {
  63. max-width: 1380px;
  64. }
  65. }
  66. }
  67. </style>