Commit b133af0f authored by 李晓兵's avatar 李晓兵

'禁用安卓物理返回键'

parent 7e24d00d
...@@ -64,6 +64,14 @@ export default { ...@@ -64,6 +64,14 @@ export default {
created: function () { created: function () {
}, },
mounted: function () { mounted: function () {
if (window.history && window.history.pushState) {
// 往历史记录里面添加一条新的当前页面的url
history.pushState(null, null, document.URL)
// 给 popstate 绑定一个方法 监听页面刷新
window.addEventListener('popstate', function(){
hlsPopup.showLongCenter('请点击左上角返回按钮返回')
}, false) // false阻止默认事件
}
}, },
updated: function () { updated: function () {
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment