I have written a global Toast plug-in for vue. One of the functions is to provide an api to pass a callback function after the toast disappears, similar to using
like this.this.$toast({
callback(){
this.$router.push("/")
}
})
but the this cannot be passed when it is implemented.
the current approach is to use a new global Vue instance via $emit/$on, but it feels like this will couple the toast plug-in with the business code. I"d like to ask how to solve this problem