Display the corresponding components after the vue project is refreshed

A page has three components that go to different components with different clicks.
the first time you enter the page displays the first component by default. If you enter the second component, click Refresh how to ensure that the page still displays the second component instead of the default. I just want to do it through the is property of the component.

Aug.09,2021

it is not enough for light to pass through the component.
solution:

  1. pass routing parameters. Enter a, add key = an in the route, and enter the bmaine c component in the same way, and decide which component to display by getting the key in the route.
  2. Click the component using localstorage, save the corresponding tag to storage, and decide to display the component by getting the tag in the store (not recommended);

Save the judged state to the global variable


save to the route or to the local storage, any place where the refresh will not disappear


add the judgment to the route, as long as the refresh does not disappear

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