I there anyhow a possibility to get always the last mesage posted by this.$q.notify by the ‘onDismiss’ handler?
<template>
<div id="q-app">
<router-view />
</div>
</template>
<script>
export default {
name: 'App',
created () {
this.$q.notify.setDefaults({
onDismiss: () => this.callNotify()
})
},
methods: {
callNotify () {
// post here always the last notify message/caption
}
}
}
</script>
a look into the sources depicts that unfortunately onDismiss doesn’t have a param.
remove (notif) {
clearTimeout(notif.meta.timer)
const index = this.notifs[notif.position].indexOf(notif)
if (index !== -1) {
if (notif.group !== void 0) {
delete groups[notif.meta.group]
}
const el = this.$refs[`notif_${notif.meta.uid}`]
if (el) {
const { width, height } = getComputedStyle(el)
el.style.left = `${el.offsetLeft}px`
el.style.width = width
el.style.height = height
}
this.notifs[notif.position].splice(index, 1)
this.$forceUpdate()
if (typeof notif.onDismiss === 'function') {
notif.onDismiss()
}
}
}
},
any chance to extend it? (because it is a plugin, not a compoment)