Modal.vue 966 Bytes
Newer Older
张锡奇's avatar
张锡奇 committed
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
<style lang="less">
    .modal{
        opacity: 0;
        display: none;
        transition: all 0.3s;
    }
    .modalActive{
        opacity: 1;
        display: block;
    }
    .modal>.content,.modal_active>.content{
        position: absolute;
        top:0;
        left:0;
        height:100%;
        width:100%;
        background: rgba(0, 0, 0, 0.5);
        z-index:999;
        display: flex;
        justify-content: center;
        align-items: center;
    }
</style>

<template>
    <div :class="showModal ? 'modal modalActive' : 'modal'">
        <div class="content">
            <slot></slot>
        </div>
    </div>
</template>

<script>
import Util from '@/libs/util.js'

export default {
  name: 'Modal',
  
  data () {
    return {
        
    }
  },
  props:{
    showModal: {
        type: Boolean,
        default: false
    },
  },
  async mounted(){
    window.d = this;

  },
  methods:{
    
  },
  components:{

  },
}
</script>