all files / src/paper/ paper.vue

0% Statements 0/7
0% Branches 0/4
100% Functions 0/0
0% Lines 0/5
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                                                                                                                                                 
<template>
<div class="mu-paper" :class="paperClass">
  <slot></slot>
</div>
</template>
 
<script>
export default {
  name: 'mu-paper',
  props: {
    circle: {
      type: Boolean,
      default: false
    },
    rounded: {
      type: Boolean,
      default: true
    },
    zDepth: {
      type: Number,
      default: 1
    }
  },
  computed: {
    paperClass () {
      var arr = []
      if (this.circle) arr.push('mu-paper-circle')
      if (this.rounded) arr.push('mu-paper-round')
      arr.push('mu-paper-' + this.zDepth)
      return arr
    }
  }
}
</script>
 
<style lang="less">
@import "../styles/import.less";
.mu-paper {
  transition: all .45s @easeOutFunction;
  color: @textColor;
  background-color: @dialogBackgroundColor;
  .depth(1);
}
 
.mu-paper-round {
  border-radius: 2px;
}
 
.mu-paper-circle {
  border-radius: 50%;
}
 
.mu-paper-1 {
  .depth(1);
}
 
.mu-paper-2 {
  .depth(2);
}
 
.mu-paper-3 {
  .depth(4);
}
 
.mu-paper-4 {
  .depth(4);
}
 
.mu-paper-5 {
  .depth(5);
}
</style>