Uncaught (in promise) TypeError: hook.bind is not a function

原文链接:Uncaught (in promise) TypeError: hook.bind is not a function – 每天进步一点点

 

使用vue3时候改了一个组件后开始报错:

Uncaught (in promise) TypeError: hook.bind is not a function
at registerLifecycleHook (runtime-core.esm-bundler.js:3516:1)
at applyOptions (runtime-core.esm-bundler.js:3520:1)
at finishComponentSetup (runtime-core.esm-bundler.js:7983:1)
at setupStatefulComponent (runtime-core.esm-bundler.js:7906:1)
at setupComponent (runtime-core.esm-bundler.js:7831:1)
at mountComponent (runtime-core.esm-bundler.js:5179:1)
at processComponent (runtime-core.esm-bundler.js:5145:1)
at patch (runtime-core.esm-bundler.js:4663:1)
at ReactiveEffect.componentUpdateFn as fn
at ReactiveEffect.run (reactivity.esm-bundler.js:222:1)

这个报错的主要原因是在vue2中使用mounted这个生命周期函数,函数写错了。

把这个函数删掉或者修改对的函数。

 

posted on 2025-12-01 16:00  longkui  阅读(5)  评论(0)    收藏  举报

导航