listenPage() { window.onbeforeunload = function (e) { e = e || window.event; if (e) { e.returnValue = '关闭提示'; } return '关闭提示'; }; }
在mounted中调用即可,当按下F5刷新时会弹出提示窗口。