all files / src/bottomSheet/ bottomSheet.vue

0% Statements 0/2
100% Branches 0/0
100% Functions 0/0
0% Lines 0/2
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                                                                                                         
<template>
  <span>
    <transition name="mu-bottom-sheet" @after-enter="show()" @after-leave="hide()">
      <div class="mu-bottom-sheet" :class="sheetClass" ref="popup" v-show="open" :style="{'z-index': zIndex}">
        <slot></slot>
      </div>
    </transition>
  </span>
</template>
 
<script>
import Popup from '../internal/popup'
export default {
  name: 'mu-bottom-sheet',
  mixins: [Popup],
  props: {
    sheetClass: {
      type: [String, Object, Array]
    }
  },
  methods: {
    show () {
      this.$emit('show')
    },
    hide () {
      this.$emit('hide')
    }
  }
}
</script>
 
<style lang="less">
@import "../styles/import.less";
.mu-bottom-sheet {
  background-color: @dialogBackgroundColor;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
}
 
.mu-bottom-sheet-enter-active,
.mu-bottom-sheet-leave-active{
  transition: transform .3s @easeOutFunction;
  backface-visibility: hidden;
}
 
.mu-bottom-sheet-enter,
.mu-bottom-sheet-leave-active{
  transform: translate3d(0, 100%, 0);
}
</style>