<template>
  <el-popconfirm
    :title="title"
    :confirmButtonText="okText"
    :cancelButtonText="cancelText"
    :confirmButtonType="okType"
    :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: "HmElementPopconfirm",
  props: {
    /**
     * 标题
     */
    title: {
      type: String,
      default: "删除",
    },
    /**
     * 确认按钮文字
     */
    okText: {
      type: String,
      default: "确认",
    },
    /**
     * 	取消按钮文字
     */
    cancelText: {
      type: String,
      default: "取消",
    },
    /**
     * 	确认按钮类型
     */
    okType: {
      type: String,
      default: "primary",
    },
    /**
     * 	取消按钮类型
     */
    cancelType: {
      type: String,
      default: "text",
    },
    /**
     * 	Icon
     */
    icon: {
      type: String,
      default: "el-icon-question",
    },
    /**
     * 	Icon 颜色
     */
    iconColor: {
      type: String,
      default: "#f90",
    },
    /**
     * 	是否隐藏 Icon
     */
    hideIcon: {
      type: Boolean,
      default: false,
    },
  },
  methods: {
    confirm(e) {
      this.$emit("confirm", e);
    },
    cancel(e) {
      this.$emit("cancel", e);
    },
  },
};
</script>

<style scoped>
</style>