When multiple routes are multiplexed with the same template, the template is not re-mounted when switching between these routes. For this situation, we need to listen to the route in the current logic, update the corresponding property when the change occurs, and satisfy the requirement.
However, in the implementation process you will encounter the following situations:
Shows that the prop attribute that was transferred to El-table when the page was switched has changed, but the inner loop binding has not changed because Vue does not listen to deep-seated object properties or array values.
The solution is to use the V-IF directive to bind the state over when the routing is switched. This assumes that the v-if= "view = = = ' Main '" represents the display, in the process of switching the view is set to ' loading ', and then the delay update to ' main ', so that the list exhibition experience "show = = disappear and show" process, the list component will go through the "mount = > Destroy the "= mount" process so that the component releases the cached data to force the update, which conforms to the design of the flexible configuration properties of our previous multi-page reusable templates.
Here is a record of my previous thinking about the solution, I hope to help you. This question examines more of our understanding of the two-way binding mechanism of component lifecycles and attributes. If you have more ideas and discussions, please leave a message for me. Thank you
Vue: About multi-routed public templates that cause intra-component array caching issues