Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeMount() {
this.staticName = this.name
/* istanbul ignore if */
if (Wormhole.hasTarget(this.staticName)) {
warn(
`A "" with name "${this.name}" already exists in the document.`,
'BToaster'
)
this.dead = true
} else {
this.doRender = true
this.$once('hook:beforeDestroy', () => {
// Let toasts made with `this.$bvToast.toast()` know that this toaster
// is being destroyed and should should also destroy/hide themselves
this.$root.$emit('bv::toaster::destroyed', this.staticName)
})
}
},
destroyed() {
ensureToaster() {
if (this.static) {
return
}
if (!Wormhole.hasTarget(this.computedToaster)) {
const div = document.createElement('div')
document.body.appendChild(div)
const toaster = new BToaster({
parent: this.$root,
propsData: {
name: this.computedToaster
}
})
toaster.$mount(div)
}
},
startDismissTimer() {