The project uses the vue1.0 version. Keep-alived is set in the routing jump and an initialization method is defined in ready. Now I have encountered a problem, that is, the page can only be opened for the first time before the data request is made. The request will not be made this time. Looking for a solution
迷茫2017-05-19 10:41:55
You can watch routing changes to call the method of requesting data and then render the page
仅有的幸福2017-05-19 10:41:55
Use hook function to initialize when routing is switched
https://github.com/vuejs/vue-...
Vue.component('hook-example', {
// ... other options
route: {
data: function () {
this.fetchData();
},
}
})