vue返回上一页面如果没有上一页面返回首页
程序员文章站
2022-04-14 22:37:07
参考链接:https://segmentfault.com/q/1010000010714863 ......
methods: { back(){ if (window.history.length <= 1) { this.$router.push({path:'/'}) return false } else { this.$router.go(-1) } } },
上一篇: 初探Electron,从入门到实践
推荐阅读