Write plug-ins to handle the problem of this delivery

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

Mar.18,2021
Try the

arrow function?


Please use the arrow function

  

you can add an input parameter and pass in the current instance

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b29b-2bac4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b29b-2bac4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?