I stumbled upon the code snippet below, which triggers the notification-alert
event and passes an object as a parameter.
this.$root.$emit('notification-alert', {
text,
type: 'warning',
click: () => this.unselect(file),
});
One thing that puzzles me is the line
click: () => this.unselect(file)
- How can a click function be assigned as a property of an object?
- What does this mean and how can we utilize this function later on?