index.vue 1.53 KB
<!-- 弹窗 -->
<template>
  <div>
    <GLDialog :bigTitle="bigTitle"  :mode="mode" :title="title" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose" :close-on-click-modal="false">
      <span slot="title">
        {{ title }}
        <span class="dialog-sub-title">
          <slot name="sub-title"></slot>
        </span>
      </span>
      <slot></slot>
      <div slot="footer">
        <slot name="btn-start"></slot>
        <el-button type="primary" size="small"  @click="handleConfirm">{{ btnOkLabel }}</el-button>
        <el-button v-if="!noCancel" size="small"  @click="handleClose">取消</el-button>
        <slot name="btn-middle"></slot>
      </div>
    </GLDialog>
  </div>
</template>

<script>
export default {
  name: 'glsx-dialog',
  data() {
    return {}
  },
  props: {
    title: {
      type: String,
      default: ''
    },
    isVisible: {
      type: Boolean,
      default: false
    },
    showClose: {
      type: Boolean,
      default: true
    },
    btnOkLabel: {
      type: String,
      default: '确定'
    },
    noCancel: {
      type: Boolean,
      default: false
    },
    btnSize: {
      type: String,
      default: 'small'
    },
    mode:{
      type: String,
      default: 'mid'
    },
    bigTitle:{
      type: String,
      default: ''
    }
  },

  methods: {
    handleClose() {
      this.$emit('closeDialog')
    },
    handleConfirm() {
      this.$emit('confirmDialog')
    }
  }
}
</script>
<style scoped>
.dialog-sub-title {
  font-size: 12px;
  color: #666666;
}
</style>