Closed lorro closed 5 years ago
The easiest way to call toast from Vuex would be to import app there. First you need to export app in the module where you init it:
export const app = new Vue(...)
And then if you want to call it outside of Vue context:
import { app } from '~/app'
And call toast:
app.$toast.info('Hello!')
You might need to check the import path as I gave an example from my Laravel Vuetify repo.
Thanks for pointing that out for me :) That works perfectly.
Hi,
I wondered if it's possible to call the toast methods without having to go through the 'this' context but with a static method or so? I would like to call this in a vuex plugin, but the 'this' context doesn't have the $toast property here unfortunately.
Thanks.