LeftRightBox.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div class="main-box main-left-right-box row">
  3. <div class="col col-12 col-lg-6 col-md-6">
  4. <img v-if="left" :src="image" alt="image" />
  5. <TitleDescBlock
  6. v-else
  7. :title="title"
  8. :desc="desc"
  9. :descLines="descLines"
  10. :showExpand="showExpand"
  11. :more="showMore"
  12. @moreClick="emit('moreClick')"
  13. />
  14. </div>
  15. <div class="col col-12 col-lg-6 col-md-6">
  16. <TitleDescBlock
  17. v-if="left"
  18. :title="title"
  19. :desc="desc"
  20. :descLines="descLines"
  21. :showExpand="showExpand"
  22. :more="showMore"
  23. @moreClick="emit('moreClick')"
  24. />
  25. <img v-else :src="image" alt="image" />
  26. </div>
  27. </div>
  28. </template>
  29. <script setup lang="ts">
  30. import TitleDescBlock from './TitleDescBlock.vue';
  31. defineProps({
  32. title : {
  33. type: String,
  34. default: '',
  35. },
  36. desc: {
  37. type: String,
  38. default: '',
  39. },
  40. image: {
  41. type: String,
  42. default: '',
  43. },
  44. descLines: {
  45. type: Number,
  46. default: 3,
  47. },
  48. left: {
  49. type: Boolean,
  50. default: false,
  51. },
  52. showExpand: {
  53. type: Boolean,
  54. default: true,
  55. },
  56. showMore: {
  57. type: Boolean,
  58. default: true,
  59. },
  60. })
  61. const emit = defineEmits([
  62. "moreClick"
  63. ])
  64. </script>
  65. <style lang="scss">
  66. .main-left-right-box {
  67. .col {
  68. position: relative;
  69. padding: 0!important;
  70. }
  71. img {
  72. max-width: 100%;
  73. }
  74. .TitleDescBlock {
  75. padding: 25px;
  76. }
  77. }
  78. </style>