Arrow function should not return assignment no return assignment.
This paper describes the problems encountered in learning p221 of the latest Vue and vuejs in 2019, from introduction to mastery. Because the checking code of eslint is referenced, the checking error is reported. There is no problem with the code, it is the problem of eslint checking.
Solutions: 1. Remove eslint
2. Modify the code to conform to eslint
original code
if (this.isSelectAll) {
this.cartList.forEach(item => item.checked = false)
} else {
this.cartList.forEach(item => item.checked = true)
}
Changed code
if (this.isSelectAll) {
this.cartList.forEach(item => { item.checked = false })
} else {
this.cartList.forEach(item => { item.checked = true })
}
After learning the arrow function, we can know that the {} added can be omitted, but the rule of eslint requires this.
Read More:
- Under the “return-d” mode, the number of “return / return” is 1
- Solve the problem of flag error valueerror: View function did not return a response
- error: ‘::main’ must return ‘int’
- C++ —Return multiple values of different types
- Python TypeError: return arrays must be of ArrayType
- Error executing Aidl: return code 1
- Vs + CUDA compilation error: msb3721, return code 255
- Waitpid call return error prompt: no child processes problem
- How Notepad + + displays all characters (for hidden carriage return spaces)
- [Android test] solution for error closed after the carriage return of the ADB shell
- error Expected an assignment or function call and instead saw an expression
- To solve the problem, start eclipse and return exit code = 13
- [Solved] hiveonspark:Execution Error, return code 30041 from org.apache.hadoop.hive.ql.exec.spark.SparkTask
- An error is reported in the idea editor missing return statement
- Execution error, return code 1 from org.apache.hadoop . hive.ql.exec .DDLTask.
- Failed: execution error, return code 1 from org.apache.hadoop . hive.ql.exec .DDLTask…
- python reads csv file is an error _csv.Error: iterator should return strings, not bytes (did you open the file in text)
- [Transfer] mdt wds deployment windows Litetouch deployment failed, Return Code = -2147467259 0x80004005 solution…
- mdt wds deployment windows Litetouch deployment failed, Return Code = -2147467259 0x80004005
- FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(me