<template>
  <el-popconfirm
    :title="title"
    :confirmButtonText="okText"
    :confirmButtonType="okType"
    :cancelButtonText="cancelText"
    :cancelButtonType="cancelType"
    :icon="icon"
    :icon-color="iconColor"
    :hide-icon="hideIcon"
    @confirm="confirm"
    @cancel="cancel"
  >
    <template #reference>
      <el-button>Delete</el-button>
    </template>
  </el-popconfirm>
</template>
<script>
export default {
  name: "confirm",
  props: {
    /**
     * 标题
     */
    title: {
      type: String,
      default: "Are you sure to delete this?",
    },
    /**
     * 确认按钮文字
     */
    okText: {
      type: String,
      default: "确认",
    },
    /**
     * 	确认按钮类型
     */
    okType: {
      type: String,
      default: "primary",
    },
    /**
     * 	取消按钮文字
     */
    cancelText: {
      type: String,
      default: "取消",
    },
    /**
     * 	取消按钮类型
     */
    cancelType: {
      type: String,
      default: "text",
    },
    /**
     * 	Icon
     */
    icon: {
      type: String,
      default: "QuestionFilled",
    },
    /**
     * 	Icon 颜色
     */
    iconColor: {
      type: String,
      default: "#f90",
    },
    /**
     * 	是否隐藏 Icon
     */
    hideIcon: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {};
  },
  methods:{
      confirm(e) {
      this.$emit("confirm", e);
    },
    cancel(e) {
      this.$emit("cancel", e);
    },
  },
  watch: {},
  mounted() {},
};
</script>