通过
this.$router.push()
跳转到页面后,跳转的页面无法加载mounted里的方法因此无法获取数据更新,只需在跳转页面加上监听
watch: {
$route() {
this.fetchData()
}
},
获取到了
通过
this.$router.push()
跳转到页面后,跳转的页面无法加载mounted里的方法因此无法获取数据更新,只需在跳转页面加上监听
watch: {
$route() {
this.fetchData()
}
},
获取到了