Attempting to import and globally define a library has been challenging for me. Despite my efforts, the global variable is not being recognized.
In main.js,
import Vue from 'vue'
import App from './App'
import router from './router'
import VueJwtDecode from 'vue-jwt-decode'
Vue.config.productionTip = false
Vue.use(VueJwtDecode)
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})
In Signup.vue,
...
const payload = VueJwtDecode.decode(res.jwt);
...
The error message indicates that VueJwtDecode is undefined.