<template>
  <div v-show="mdShow" class="message-box__wrapper">
      <div class="message-box">
        <div class="message-box__content">
          <div class="message-box__message"><p>{{message}}</p></div>
          <div class="message-box__input">
            <slot></slot>
          </div>
        </div>
        <div class="message-box__btns">
          <div class="fr">
            <button class="mgr5 button--primary button--defalut" @click="closeModal">取&nbsp;&nbsp;消</button>
            <button class="button--primary" @click="comfirm" :disabled="disabled">确&nbsp;&nbsp;定</button>
          </div>
        </div>
      </div>
    </div>
</template>

<script>
export default {
  name: 'Modal',
  props: {
    mdShow: Boolean,
    message: String,
    disabled: Boolean
  },
  methods: {
    closeModal () {
      this.$emit('closeModalCallback')
    },
    comfirm () {
      this.$emit('comfirmCallback', this.type)
    }
  }
}
</script>
