PostItem.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <div class="col-md-4 col-sm-6 col-12">
  3. <q-card flat
  4. class="PostItem">
  5. <div class="thumbnail">
  6. <router-link :to="{name: 'Public.Post.Show', params: {id: post.id}}">
  7. <q-img :src="post.thumbnail" />
  8. </router-link>
  9. </div>
  10. <div class="title ellipsis-2-lines">
  11. <router-link :to="{name: 'Public.Post.Show', params: {id: post.id}}">
  12. {{post.title}}
  13. </router-link>
  14. </div>
  15. <div class="child-category ellipsis-2-lines">
  16. <router-link :to="{name: 'Public.ContentCategory.Show', params: {category_id: post.category_info?.id}}">
  17. <q-icon name="account_tree" />
  18. دسته:
  19. {{post.category_info?.title}}
  20. </router-link>
  21. </div>
  22. <q-card-actions class="action-section">
  23. <q-btn color="primary"
  24. class="btn-show-post"
  25. :to="{name: 'Public.Post.Show', params: {id: post.id}}">
  26. مشاهده جزئیات
  27. </q-btn>
  28. </q-card-actions>
  29. </q-card>
  30. </div>
  31. </template>
  32. <script>
  33. import { defineComponent } from 'vue'
  34. import { Post } from 'src/models/Post.js'
  35. export default defineComponent({
  36. name: 'PostItem',
  37. props: {
  38. post: {
  39. type: Post,
  40. default: new Post()
  41. }
  42. }
  43. })
  44. </script>
  45. <style lang="scss" scoped>
  46. .PostItem {
  47. background-color: #f6f6f6;
  48. border-radius: 54px 0 54px 54px;
  49. padding: 20px 20px 30px;
  50. margin: 8px;
  51. .thumbnail {
  52. margin-bottom: 43px;
  53. .q-img {
  54. border-radius: 54px 0 54px 54px;
  55. }
  56. }
  57. .title {
  58. font-size: 17px;
  59. letter-spacing: 0;
  60. padding-right: 26px;
  61. padding-left: 26px;
  62. margin-bottom: 16px;
  63. a {
  64. color: #475F4A;
  65. }
  66. }
  67. .child-category {
  68. font-size: 17px;
  69. letter-spacing: 0;
  70. padding-right: 26px;
  71. padding-left: 26px;
  72. margin-bottom: 31px;
  73. a {
  74. color: #475F4A;
  75. }
  76. }
  77. .action-section {
  78. .btn-show-post {
  79. width: 100%;
  80. height: 48px;
  81. max-width: 252px;
  82. margin: auto;
  83. }
  84. }
  85. }
  86. </style>