All files / src Slide.vue

88.24% Statements 15/17
60% Branches 6/10
80% Functions 4/5
83.33% Lines 10/12
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 413x     3x     3x     28x         28x       28x           3x 3x 56x 3x                          
<template>
  <div class="slide"
    v-bind:style="`
      flex-basis: ${width}px;
      visibility: ${width ? 'visible' : 'hidden'}
    `"
    >
    <slot></slot>
  </div>
</template>
 
<script>
  export default {
    name: "slide",
    Idata() {
      return {
        width: null,
      }
    },
    mounted() {
      if (this.$isServer) {
        return
      }
 
E      // Disable drag event
      this.$el.addEventListener("dragstart", e => e.preventDefault())
    }
  }
</script>
 
<style scoped>
  .slide {
    flex-grow: 0;
    flex-shrink: 0;
    user-select: none;
 
    backface-visibility: hidden;
    -webkit-touch-callout: none;
  }
</style>