TypeError: _this.setStore is not a function at eval
程序员文章站
2024-01-03 13:55:16
...
vue项目控制台报Uncaught (in promise) TypeError: _this.setStore is not a function at eval 错误!!!
原因:this调用的setStore函数不是全局的不属于this对象,需要导入
import {setStore} from "../libs/storage";
直接setStore调用
setStore("userInfo", res.data.user);
推荐阅读
-
TypeError: _this.setStore is not a function at eval
-
Error in created hook: “TypeError: Object(...) is not a function“
-
TypeError: 'function' object is not subscriptable
-
JS中注入eval, Function等系统函数截获动态代码
-
d3.svg.line()错误:TypeError: d3.svg.line is not a function
-
Vue 报错TypeError: this.$set is not a function 的解决方法
-
UnhandledPromiseRejectionWarning: TypeError: loaderContext.getResolve is not a function
-
关于Uncaught TypeError: validator.resetForm is not a function错误的问题
-
vuejs路由使用的问题Error in render function: "TypeError: Cannot read property 'matched' of undefined"
-
eval 和 new Function