function closeWindow(){
var userAgent = navigator.userAgent;
if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") !=-1) {
window.location.href="about:blank";
window.close();
} else {
window.opener = null;
window.open("", "_self");
window.close();
}
}
或者:
window.open("about:blank","_self").close()
当在vue+chrome中使用时,有些chrome版本智能跳转到about:blank空页面中,无法关闭当前页面,目前没有找到解决办法