解决Uncaught (in promise) TypeError: Object(...) is not a function报错

今天搬砖的时候遇到一个报错

问题:
Uncaught (in promise) TypeError: Object(…) is not a function
如图所示
在这里插入图片描述

原因:
经过排查,发现原因是导入的JS方法没有用大括号接收,然后又把它当做方法调用了。低级错误

解决方法:
导入的js方法要用大括号接收:

import {
    
    callMethodLimitPage} from './getAllData.js'

猜你喜欢

转载自blog.csdn.net/weixin_44582045/article/details/124479047
今日推荐