-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Hello folks.
I want to fire toasts on event add and event remove. I have a plugin managing these events. When I fire the toasts they just blink, disappears immediately.
I have tried changing the scope from this.$bvToast.toast to this.$root.$bvToast.toast but still the same error.
My plugin is like this:
/plugins/user-actions.js
`
export default {
install(Vue, options) {
Vue.prototype.$addUserTalk = function (talk) {
[...]
this.$root.$bvToast.toast('Added event '+talk.title, {
title: 'Added event',
autoHideDelay: 50000,
variant: "success",
appendToast: false
})
}
Vue.prototype.$removeUserTalk = function (talkId) {
[...]
this.$root.$bvToast.toast('The event '+talkTitle+' was removed', {
title: 'Event removed',
autoHideDelay: 50000,
variant: "danger",
appendToast: false
})
}
}
}
`
This is how I call the function from the Component:
addUserTalk(talk) { this.$addUserTalk(talk); this.$emit('update:selectTalk', talk); } deleteEvent(e) { this.$removeUserTalk(e.id); this.getTalks(); }