In the Vue calculation property, what happens when an array object uses the map function to report an error?

A calculation property code in the vue component relies on another calculation property projectPath (which has only array or undefined values), but calls map in code"s calculation function and reports

TypeError: this.projectPath.map(...) is not a function
< H2 > what is the reason for this? < / H2 >

Code:

   

May.18,2022

your error report says pathList while your printout is projectPath .

you should see if pathList is null or undefined .


I tricked myself for half an hour. An error was written elsewhere, causing the vue not to be updated automatically. Here there should be a problem with the old code, but there is no update after correction, resulting in a mismatch between the code and the error report.


because your projectPath initial value is not an array, there is no map method on his prototype.

you can read this article https://blog.csdn.net/wxl1555...

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9f8fc-1a69.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9f8fc-1a69.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?