How does vue keetp-alive affect watch $route?

Caiji encountered a problem:
the router-view of app.vue is covered with a layer of keep-alive
when switching between secondary pages, you can enter and leave watch $route

however, if keepalive is removed, the watch is less than the entry and departure of $route, and neither the entry nor departure of the routing guards in the component can trigger

did I write bug, or will watch and guards be affected by keep alive?


this depends on where your watch is written.

if you are inside the page watch $route , then if there is no keepalive, there will be no watch, because the page has been destroyed after the route left. The purpose of keepalive is to keep the page even after the route leaves.

keepalive

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