F5刷新浏览器,重新赋值当前路由name。
怎么监听浏览器刷新?
不要被浏览器迷惑,vue的生命周期钩子,刷新浏览器Created与mounted是重新跑的。
只需要在mounted中加上
mounted() { this.routeName= this.$route.name },
就可以了。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/224118.html原文链接:https://javaforall.net
vue获取当前路由nameF5 刷新浏览器 重新赋值当前路由 name 怎么监听浏览器刷新 不要被浏览器迷惑 vue 的生命周期钩子 刷新浏览器 Created 与 mounted 是重新跑的 只需要在 mounted 中加上 mounted this routeName this route name 就可以了
F5刷新浏览器,重新赋值当前路由name。
怎么监听浏览器刷新?
不要被浏览器迷惑,vue的生命周期钩子,刷新浏览器Created与mounted是重新跑的。
只需要在mounted中加上
mounted() { this.routeName= this.$route.name },
就可以了。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/224118.html原文链接:https://javaforall.net