Blame view

src/components/split/trigger.vue 737 Bytes
8979c734   zhigang.li   add split components
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
  <template>
    <div :class="classes">
      <div :class="barConClasses">
        <i :class="`${prefix}-bar`" v-once v-for="i in 8" :key="`trigger-${i}`"></i>
      </div>
    </div>
  </template>
  
  <script>
  export default {
    name: 'Trigger',
    props: {
      mode: String
    },
    data () {
      return {
        prefix: 'ivu-split-trigger',
        initOffset: 0
      }
    },
    computed: {
      isVertical () {
        return this.mode === 'vertical'
      },
      classes () {
        return [
          this.prefix,
          this.isVertical ? `${this.prefix}-vertical` : `${this.prefix}-horizontal`
        ]
      },
      barConClasses () {
        return [
          `${this.prefix}-bar-con`,
          this.isVertical ? 'vertical' : 'horizontal'
        ]
      }
    }
  }
  </script>