Using Vue to report an error

using Vue to report an error [Vue warn]: Error in nextTick: "TypeError: fn.bind is not a function"
page cannot be entered.
clipboard.png

Apr.05,2021

read the error message is that there is a method in methods that you write is not a function, you may write an object or something. When vue does fn.bind () processing, .bind may get undefined.


share a little bit of my experience of handling this exception.
vm.$options.methods there are objects in this array that are not of type function.
how did this come about?
uses this form of call when calling component methods, this.$options.methods.fun () , and the this in this fun does not point to vm, but to this this.$options.methods object. If you have code such as this.xx= [] in fun, it will report such an exception.


Hello, have you solved it? I have exactly the same problem


check the method


in your methods to see if data mounted methods is writing a method or an object


it should mean that you are now using the element of the .bind method that does not have the bind method. You can first take a look at the element console


if this sentence appears, you can see which sentence this error occurs. Fn.bind appears in the vue code. For example, the 2.5.13 version of vue does not report an error, but if you upgrade to a new version, this will be wrong. So I suggest changing the version of vue


is it the error of the port report?


This error also occurs when you register a component in the

Vue.component (name, comp) mode.

my situation is slightly complicated. I used the above method to register the global component, which is used through v-else-if on the page, and only uses the component when the condition is met, in which case the error message occurs.

I re-registered the component on the page to solve this problem.


this kind of error can be solved by looking at the console. Fn.bind is not a method.

Menu