Is there a way to generate a Buefy notification without utilizing a Vue component? Specifically, I'm attempting to implement a Buefy notification within the axios interceptor below:
import axios from "axios";
import { Notification } from "buefy/dist/components/notification";
axios.interceptors.response.use(
response => {
if (response.data.flash) {
Notification.open(response.data.flash);
}
return response;
},
error => {
if (error.response) {
Notification.open(error.response.data.flash);
return Promise.reject(error.response);
}
}
);
export default axios;
This configuration triggers the following error in the console:
[Vue warn]: Error in v-on handler (Promise/async): "TypeError: Cannot read property 'open' of undefined"
Any insights on what might be causing this issue?