<template>
  <apbd-confirm-popover msg="Are you sure to remove it" :item-data="itemData"
                        @onConfirmed="dataHandler">
    <button class="ms-3 btn btn-cr btn-xs btn-danger" @click="stopEvent($event)"
            v-tooltip="Remove">
      Test
    </button>
  </apbd-confirm-popover>
</template>

<script>
import ApbdConfirmPopover from "@/components/ApbdConfirmPopover.vue";

export default {
  name: "TestApbdConfirmPopover",
  components: {ApbdConfirmPopover},
  data() {
    return {
      itemData: 1
    }
  },
  methods: {
    stopEvent(e, id) {
      e.preventDefault();
      e.stopPropagation();
    },
    dataHandler({showLoader, itemData, closePopover}) {
      /*
      Do something based on itemData
      */
      closePopover(); // This is for close the popover
    }
  }
}
</script>

<style scoped lang="scss">

</style>