๐Ÿ“ฆ vuetifyjs / material-kit-theme

๐Ÿ“„ WhereIveBeen.vue ยท 72 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<template>
  <core-section id="where-ive-been">
    <core-heading>Where I've been</core-heading>

    <v-col
      cols="12"
      md="9"
      class="mx-auto px-0"
    >
      <v-timeline
        :dense="$vuetify.breakpoint.smAndDown"
        :light="light"
      >
        <v-timeline-item
          v-for="(item, i) in items"
          :key="i"
          v-bind="getAttrs()"
        >
          <span
            slot="opposite"
            v-text="item.startDate.slice(0, 4)"
          />

          <v-card class="pa-3">
            <h3
              class="subheading font-weight-bold"
              v-text="item.company"
            />
            <div v-text="item.summary" />
          </v-card>
        </v-timeline-item>
      </v-timeline>
    </v-col>
  </core-section>
</template>

<script>
  // Utilities
  import {
    mapState,
  } from 'vuex'

  export default {
    name: 'WhereIveBeen',

    data: vm => ({
      light: vm.random(),
    }),

    computed: {
      ...mapState('app', ['schema']),
      items () {
        return this.schema.work
      },
    },

    methods: {
      getAttrs () {
        const attrs = {}

        if (this.random()) attrs.fillDot = true
        if (this.random()) attrs.largeDot = true

        return attrs
      },
      random () {
        return Boolean(Math.round(Math.random()))
      },
    },
  }
</script>