The solution to the problem that the vue.js route this.route.push jump page does not refresh: Use the [activated:{}] periodic function instead of the [mounted:{}] function, the code is [this.$router. go(0);].
【Related article recommendations: vue.js】
vue.js routingthis Solution to .route.push jump page not refreshing:
1. Use the activated:{}
periodic function instead of the mounted:{}
function. Can.
2. Monitor routing
// 不推荐、用户体验不好 watch: { '$route' (to, from) { // 路由发生变化页面刷新 this.$router.go(0); } }, // 该方法会多一次请求 watch: { '$route' (to, from) { // 在mounted函数执行的方法,放到该处 this.qBankId = globalVariable.questionBankId; this.qBankName = globalVariable.questionBankTitle; this.searchCharpter(); } },
Related free learning recommendations: JavaScript (video)
The above is the detailed content of What to do if vue.js route this.route.push jump page does not refresh. For more information, please follow other related articles on the PHP Chinese website!