TopicItem.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <q-card class="ContentTopicItem"
  3. flat>
  4. <div class="thumbnail">
  5. <router-link :to="{name: 'Public.Content.Show', params: {id: contentTopic.content}}">
  6. <q-img :src="contentTopic.thumbnail" />
  7. </router-link>
  8. </div>
  9. <div class="texts">
  10. <div class="title ellipsis-2-lines">
  11. <router-link :to="{name: 'Public.Content.Show', params: {id: contentTopic.content}}">
  12. {{ contentTopic.title }}
  13. </router-link>
  14. </div>
  15. <div v-if="contentTopic.content_info"
  16. class="content"
  17. v-html="contentTopic.content_info.description" />
  18. </div>
  19. </q-card>
  20. </template>
  21. <script>
  22. import Assist from 'src/assets/js/Assist.js'
  23. import { ContentTopic } from 'src/models/ContentTopic.js'
  24. export default {
  25. name: 'ContentTopicItem',
  26. props: {
  27. contentTopic: {
  28. type: ContentTopic,
  29. default: new ContentTopic()
  30. }
  31. },
  32. methods: {
  33. miladiToShamsi (date) {
  34. return Assist.miladiToShamsi(date, 'jDD jMMM jYYYY')
  35. }
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .ContentTopicItem {
  41. display: flex;
  42. flex-flow: row;
  43. gap: 24px;
  44. justify-content: flex-start;
  45. border-radius: 20px;
  46. padding: 32px 28px;
  47. background: #FBF4EA;
  48. $thumbnail-width: 250px;
  49. .thumbnail {
  50. width: $thumbnail-width;
  51. border-radius: 10px;
  52. .q-img {
  53. width: 100%;
  54. border-radius: 10px;
  55. }
  56. }
  57. .texts {
  58. width: calc(100% - #{$thumbnail-width});
  59. padding-top: 24px;
  60. .title {
  61. color: #212121;
  62. font-size: 16px;
  63. font-weight: bold;
  64. margin-bottom: 28px;
  65. }
  66. .content {
  67. color: #212121;
  68. font-size: 16px;
  69. }
  70. }
  71. @media screen and (max-width: 600px) {
  72. flex-flow: column;
  73. .thumbnail {
  74. width: 100%;
  75. }
  76. .texts {
  77. width: 100%;
  78. }
  79. }
  80. }
  81. </style>