When using vue.js for development, the most used is created, mounted, activated.
Because there are cases where we need to reuse some components, we need to use keep-alive.
When the introduction of Keep-alive, the first time the page entered, the trigger order of the hook is created-> mounted-> activated. When you enter the page again, only the activated is triggered.
Therefore, you should leave a copy of the data obtained in the activated code, or do not created part of the code to directly transfer created in activated.
Created: the instance is called after it has been created, and the method that triggers the function is triggered when the page is just entered. Executes only once when the page has just started loading.
Mounted: The method is executed when the page is loaded.
Called when the activated:keep-alive component is activated. This is called when the page has a cache.
Vue.js life cycle hook functions and caches