代码
created(){
//页面加载时就从本地通过localstorage获取存储的token值
this.token = localStorage.getItem('token')
// 解析获取token
const jwt_decode = require('jwt-decode');
console.log(this.token)
console.log(jwt_decode(this.token))},
报错
[Vue warn]: Error in created hook: "TypeError: jwt_decode is not a function"
found in
---> <Index2> at src/components/Index2.vue
<App> at src/App.vue
<Root>