<template>
  <el-dialog title :visible.sync="dialogVisible" :width="width" @close="handleClose">
    <div class="result">
      <p>
        <i :class="cl"></i>{{ title }}
      </p>
      <p class="gray02 line-h20">{{ info }}</p>
      <el-button v-if="!$slots.footer" class="mt30" @click="handleClose">关闭</el-button>
      <slot v-else name="footer"></slot>
    </div>
  </el-dialog>
</template>

<script>

export default {
  name: 'AddSubAppResult',
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    // 提示信息的icon
    cl: {
      type: String,
      default: 'el-icon-success success-color'
    },
    width: {
      type: String,
      default: '420px'
    },
    title: {
      type: String
    },
    info: {
      type: String
    }
  },
  methods: {
    handleClose() {
      // 清空数据
      this.$emit('update:dialogVisible', false);
      this.$emit('handleClose');
    }
  }
};
</script>

<style lang="scss" scoped>
.result {
  text-align: center;
  p:first-child {
    color: #303133;
    font-size: 14px;
    line-height: 24px;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
  }
  i {
    font-size: 24px;
    margin-right: 8px;
  }
}
</style>