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

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

<style scoped></style>
