Article.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <v-col
  3. v-if="!pictureRight && mdAndUp"
  4. cols="12"
  5. md="6"
  6. class="image-container d-flex justify-center"
  7. >
  8. <v-img max-width="350" :src="article.image" :alt="article.imageAlt" />
  9. </v-col>
  10. <v-col cols="12" md="6">
  11. <h3>{{ article.title }}</h3>
  12. <p>{{ article.text }}</p>
  13. <v-btn max-width="510px" :href="article.btnHref" target="_blank">
  14. {{ article.btnTitle }}
  15. </v-btn>
  16. </v-col>
  17. <v-col
  18. v-if="pictureRight || (mdAndDown && !md)"
  19. cols="12"
  20. md="6"
  21. class="image-container d-flex justify-center"
  22. >
  23. <v-img max-width="350" :src="article.image" :alt="article.imageAlt" />
  24. </v-col>
  25. </template>
  26. <script setup lang="ts">
  27. import type { PropType } from 'vue'
  28. import { useDisplay } from 'vuetify'
  29. import type { Article } from '~/types/interface'
  30. const { mdAndUp, mdAndDown, md } = useDisplay()
  31. defineProps({
  32. article: {
  33. type: Object as PropType<Article>,
  34. required: true,
  35. },
  36. pictureRight: {
  37. type: Boolean,
  38. default: true,
  39. },
  40. })
  41. </script>
  42. <style scoped lang="scss">
  43. .v-btn {
  44. background: var(--secondary-color);
  45. color: var(--on-secondary-color);
  46. margin-top: 20px;
  47. }
  48. </style>