Hi,
Here is my app.js code:
import mitt from 'mitt'
const emitter = mitt();
app.config.globalProperties.$bus = emitter;
Here is my ActionButton.vue code
<script>
export default {
props: ["data", "index",'showDelete'],
methods: {
getBasicDetails(id) {
this.$bus.emit("details", id);
},
deleteRecord(id) {
this.$swal
.fire({
title: "Are you sure?",
html: "You want to delete",
icon: "warning",
showCancelButton: true,
confirmButtonColor: "#60217D",
cancelButtonColor: "#d33",
confirmButtonText: "Yes",
})
.then((result) => {
if (result.value) {
this.$bus.emit("delete", id);
}
});
},
},
};
</script>
When we click on the edit button that time this.$bus.emit() event is not fire. can you please help me for the error occured.
Thanks!