vue后退判断是否有历史记录,有就返回上一级,否则返回指定路由
Vue.prototype.back = function (route) { if (window.history.length > 1) { this.$router.back(); } else { this.$router.push(route); } }
- 上一篇 »linux设置history历史记录
- 下一篇 »linux中判断一个命令是否执行成功
Vue.prototype.back = function (route) { if (window.history.length > 1) { this.$router.back(); } else { this.$router.push(route); } }