๐Ÿ“ฆ vuetifyjs / flairo-theme

๐Ÿ“„ Post.vue ยท 78 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78<script setup lang="ts">
  interface Props {
    post: {
      src?: string
      title: string
      author?: string
      date: string
      commentCount?: string
      text: string
      description?: string
      to: string
      comments?: any[]
    },
    clamp?: number | string
  }

  withDefaults(defineProps<Props>(), {
    clamp: 0,
    text: '',
  })
</script>

<template>
  <v-row>
    <Avatar
      :key="`post-date`"
      class="ma-2"
      color="surface-variant"
      size="100"
      tile
    />
    <v-col class="pl-2">
      <Title
        :title="post.title"
        class="text-primary"
        size="title"
        space="0"
      />
      <Body
        :key="`post-text`"
        :clamp="clamp"
        :text="post.text"
        space="0"
      />
      <div>
        <RouterLink
          v-if="post.to"
          :to="post.to"
          class="text-primary"
          style="text-decoration: none;"
        > Read More </RouterLink>
        <template v-if="post.date">
          <v-icon
            class="ml-4 mr-2"
            icon="mdi-clock-outline"
            small
          />
          <span v-text="post.date" />
        </template>
        <template v-if="post.comments">
          <v-icon
            class="ml-4 mr-2"
            icon="mdi-comment"
          />
          <span
            class="font-italic"
            v-text="'comments'"
          />
        </template>
      </div>
    </v-col>
  </v-row>
</template>

<style lang="scss" scoped>

</style>