I don’t know what is missing. Now the address has changed but the data has not changed. Please give me guidance, I am new to vue-router
温故而知新,可以为师矣。 博客:www.ouyangke.com
There are the following points:
Not all Router have name, so maybe key() is a fake branch. Since $route is an object, $route + +new Date() is possible is an invalid value
Router
name
key()
$route
$route + +new Date()
$route.matched may not contain a name value, so the filter method may return an empty array, making subsequent data processing impossible.
$route.matched
filter
If it is hot loading, it is recommended to force refresh the browser cache.
There are the following points:
Not all
Router
havename
, so maybekey()
is a fake branch. Since$route
is an object,$route + +new Date()
is possible is an invalid value$route.matched
may not contain aname
value, so thefilter
method may return an empty array, making subsequent data processing impossible.If it is hot loading, it is recommended to force refresh the browser cache.