<template>
  <VaButton size="small" :round="false" color="danger" class="mr-6 mb-2" @click="goDelete" icon="delete">
    删除用户
  </VaButton>
</template>

<script>
  export default {
    name: 'deleteUserBtn',
    props: {
      params: {
        default: () => {},
      },
    },
    methods: {
      goDelete() {
        this.$vaModal
          .confirm({ message: '确定删除此用户?', title: '提醒?', size: 'medium', okText: '确定', cancelText: '取消' })
          .then((ok) => {
            this.$api.deleteUser({ id: this.params.id }).then((res) => {
              this.$toast.success({ message: res.message })
              this.$emit('after-op')
            })
          })
      },
    },
  }
</script>

<style scoped></style>
