Article.vue 1.2 KB

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