How to use it outside vue instance ?
See original GitHub issuei want to show notification with this plugin every error request in axios interceptor ?
Axios interceptors
axios.interceptors.response.use((response) => {
return response
}, function (error) {
console.log('Error Axios Hanlder', error.response)
this.$notify({
group: 'foo',
title: 'Important message',
text: 'Hello user! This is a notification!'
})
return Promise.reject(error)
})
Error
Uncaught (in promise) TypeError: __WEBPACK_IMPORTED_MODULE_2_vue__.default.$notify is not a function
at eval (index.js?2848:10)
at <anonymous>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to access data from outside the instance in Vue js?
To access vue.js object datas from inside you can use $property_name. Example. var vm = new Vue({ el: '#app', data() { return {...
Read more >Accessing a Vue instance outside of its declaration
Learn how to access Vue instances after having declared them and how to change data properties, invoke methods, etc. on already declared Vue ......
Read more >Vuejs instance variable outside instance - Get Help - Vue Forum
Let's say I want to use/export this selectedPerson to another js script outside the Vue instance. Is this possible??
Read more >How to Use Vue Router Outside Vue Instance - Nesin.io
How to Use Vue Router Outside Vue Instance ; import router from './router' ; // redirect to different route router.push ; {name:'standard_error'} ...
Read more >Use objects outside VUE - Laracasts
Hello, I was wondering how to use objects outside VUE. For example, from my Script.vue I want to access an object, how do...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Anyone managed to call it in axios response interceptor??
It worked for me:
On main.js
On axios.js