vue common mistakes

1. Vue common grammatical errors

0. Cancel strict mode

There will be a separate .eslintrc.js file in the vue cli4 project. This js file is the configuration item of the code specification. You can try to comment out '@vue/standard', that is, close the Eslint grammar specification comment and restart the project.
insert image description here
npm Run serve
reference: https://www.jb51.net/article/244367.htm

1.error Unexpected trailing comma comma-dangle

Translation: There is an extra symbol in the back
Solution: Delete the comma in the red box
insert image description here

2.error Trailing spaces not allowed no-trailing-spaces

Translation: more blank lines
Solution: delete blank lines at wrong position

3. Invalid handler for event “click”: got undefined

Check @click='xxx' to see if this xxx function is defined.
Check @click='xxx' to see if there is any typo in this xxx function.
Check @click='xxx' to see if this xxx function is placed in methods.
Check @click='xxx' to see if the xxx function is named in camel case.

Guess you like

Origin blog.csdn.net/m0_53195006/article/details/130497540