百变鹏仔-专注前端行业精选
vue中如何点击返回上一页,vue判断没有上页返回首页
作者:鹏仔先生日期:2021-02-04 14:28:08浏览:2799分类:JavaScript
vue中如何点击返回上一页,vue判断没有上页返回首页
vue中返回上一页
// 返回 returnBtn(){ this.$router.go(-1); },
返回上一页,先判断是否有上一页,没有则返回指定页面
// 返回 returnBtn(){ if (window.history.length <= 1) { this.$router.push({path:'/'}); return false } else { this.$router.go(-1); } },
猜你还喜欢
- 07-08 VUE中ECharts提示框tooltip自动切换
- 07-03 网页中生成微信小程序二维码
- 07-02 微信小程序判断是安卓还是苹果
- 06-28 vue实现表格自动滚动功能 vue-seamless-scroll
- 06-25 uniapp页面跳转的几种方式
- 04-19 VUE实现点击复制
- 04-16 vue将页面生成图片 vue生成海报
- 04-16 vue路由切换滑动效果 vue页面跳转交互 vue实现动画跳转
- 04-16 table固定表头和列 css实现表格固定表头
- 04-07 vue跳转页面清除历史记录,页面跳转删除历史记录
- 02-22 VUE You are using the runtime-only build of Vue where the template compiler is not available. Either
- 01-19 elementui多选上传 before-upload 格式效验错误总会触发before-remove (elementui多选上传on-success只执行了一次,只上传成功了一条)
暂无评论,来添加一个吧。