The vue project reports an error on the browser control side: Error in v-on handler: “TypeError: xxx is not a function” Problem analysis and solution

Project scenario:

提示:这里简述项目相关背景:
The vue project reports an error on the browser control side: Error in v-on handler: “TypeError: xxx is not a function“


Problem Description

提示:这里描述项目中遇到的问题:

The vue project reports an error on the browser control side: Error in v-on handler: “TypeError: xxx is not a function“

insert image description here

Cause Analysis:

analyse problem:

TypeError: xxx is not a function

1 The function name is spelled wrong, check for spelling mistakes.

2 There is a method of repeated naming, and the system uses a function that does not contain this error.

3 The variable and function are named repeatedly, and the naming priority of the function is higher than that of the variable.

solution:

Tip: Fill in the specific solution to the problem here:

1. First check whether the function name of the calling method in the code is written consistently. Be sure to check carefully. A difference of one letter is not allowed.
2. Check whether the location of the called method is written in methods, all methods must be included in the method, otherwise the call will fail.
3. The method name is unique. In a page, there cannot be repeated method names, otherwise, the method call will fail. That is, the function name defined by the declaration cannot be the same as the id name of a tag on the page. Some browsers can access the node element only by specifying the id in the js code, and then the element in the DOM will override the function defined by the declaration.

This question reminds us that we must be careful and careful when writing code! ! !

Guess you like

Origin blog.csdn.net/YHLSunshine/article/details/130091646