问题截图:
解决办法:
1、进入页面后获取当前的url
created() {
this.firstUrl = window.location.href
},
打开模态框
handleRowClick(){
$("#motaikuang").modal('show');
//模态框显示之后增加一个历史记录
window.history.pushState({}, this.firstUrl);//firstUrl为当前页面的url
},
2、点击手机系统返回键
mounted() {
//按返回键时监听模态框是否显示,若显示则关闭
window.addEventListener("popstate", function(e) {
if($("body").hasClass("modal-open")){
$("#mo