all files / src/grid/ col.vue

0% Statements 0/10
0% Branches 0/4
100% Functions 0/0
0% Lines 0/10
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                                                                                   
<template>
<div class="col" :class="classObj">
  <slot></slot>
</div>
</template>
 
<script>
export default {
  name: 'mu-col',
  props: {
    width: {
      type: String,
      default: '100'
    },
    tablet: {
      type: String,
      default: ''
    },
    desktop: {
      type: String,
      default: ''
    }
  },
  computed: {
    classObj () {
      let className = 'col-' + this.width
      let classObj = {}
      classObj[className] = true
      if (this.tablet) {
        let tablet = 'tablet-' + this.tablet
        classObj[tablet] = true
      }
      if (this.desktop) {
        let desktop = 'desktop-' + this.desktop
        classObj[desktop] = true
      }
      return classObj
    }
  }
}
</script>