The vue page jumps to the same page multiple times to update data

1. The demand is like this. You can jump from the parent page to the subpage by carrying the id. At the same time, you can return to the parent page and carry another id to jump back to the subpage. We want to update it with the id brought by the url every time we enter the subpage. Page data, then the conventional use of created and mounted hooks to call the data interface is obviously not possible, because the page has been created at this time, and these two hooks will no longer be called. You can use these two:

activated () {
  console.log(‘实例被激活时使用,用于重复激活一个实例的时候’)
}
deactivated () {
  console.log(‘实例没有被激活时’)
}

Guess you like

Origin blog.csdn.net/m0_56683897/article/details/130012610