在页面的watch中,监听$router的变化
watch: { $route (to, from) { this.$router.go(0) } }
其中this.$router.go(0)为刷新页面,但此方法可能在Safari中无法实现,还可以用js原生的方法:window.location.reload()
在页面的watch中,监听$router的变化
watch: { $route (to, from) { this.$router.go(0) } }
其中this.$router.go(0)为刷新页面,但此方法可能在Safari中无法实现,还可以用js原生的方法:window.location.reload()
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。