<template>
  <span>
    <el-popconfirm width="220" confirm-button-text="确定" cancel-button-text="取消" icon-color="#626AEF" :title="title"
      @confirm="confirmEvent" @cancel="cancelEvent">
      <template #reference>
        <span class="operdel" @click="handleClick"><el-icon>
            <Link />
          </el-icon>{{ props.delContent }}</span>
      </template>
    </el-popconfirm>
  </span>
</template>

<script setup>
import { defineEmits, defineProps } from "vue";
const emits = defineEmits(["isNot"]);
// 数据
const props = defineProps({
  delContent: {
    type: String,
    default: ""
  },
  delTitle: {
    type: String,
    default: ""
  },
  ids: {
    type: String,
    default: ""
  }
});
const title = props.delTitle;
const confirmEvent = () => {
  if (props.delContent === '删除') {
    emits("isNot", props.ids);
  }
  else emits("isNot", props.delTitle, props.ids);
};
</script>
<style lang="scss">
.el-popconfirm {
  background: #fff;
  padding: 0px 20px;
  box-sizing: border-box;
  border-radius: 10%;
}

::v-deep .el-popover {
  background-color: transparent !important;
}

.el-popconfirm__main {
  margin-bottom: 26px;
}
</style>