How to judge the currently selected item of the array in vue?

is there a boss who can help explain the principle of this line of code? Yesterday, a big guy in the group shared the method. I used it and realized the function, but I don"t understand why, which are vue and which are js native
nextRoute.indexOf (to.name). In this line, I really don"t understand

.
Mar.13,2021

to.name is the name of the destination routing object to be entered. look at this


The global guard hook function in

beforeEach vue routing passes three parameters, so I will not explain each of the destination routing objects that
to: Route: is about to enter.
next () must call this method to resolve the hook before it can be executed.

The meaning of

nextRoute.indexOf (to.name) is obvious

whether the routing object name to be entered is included in the nextRouter array, including next () is ok


execute this condition if the route fragment to be entered ( record ) exists in the nextRoute array

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-1bdfe61-30812.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-1bdfe61-30812.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?