Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-xcmg-vue-app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xugong
hls-xcmg-vue-app
Commits
7ffc2d8a
Commit
7ffc2d8a
authored
Oct 28, 2019
by
李晓兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'禁用安卓物理返回键'
parent
4f94472e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
15 deletions
+13
-15
index.html
index.html
+10
-0
main.js
src/main.js
+2
-7
my-product-list.Vue
src/pages/myProductCollection/my-product-list.Vue
+1
-8
No files found.
index.html
View file @
7ffc2d8a
...
...
@@ -21,5 +21,15 @@
<body>
<div
id=
"app-box"
></div>
<!-- built files will be auto injected -->
<script>
if
(
window
.
history
&&
window
.
history
.
pushState
)
{
// 往历史记录里面添加一条新的当前页面的url
history
.
pushState
(
null
,
null
,
document
.
URL
)
// 给 popstate 绑定一个方法 监听页面刷新
window
.
addEventListener
(
'popstate'
,
function
(){
alert
(
'请点击左上角返回按钮返回'
)
},
false
)
// false阻止默认事件
}
</script>
</body>
</html>
src/main.js
View file @
7ffc2d8a
...
...
@@ -153,19 +153,14 @@ vum.$vumPlatform.ready(function () {
}
})
if
(
window
.
history
&&
window
.
history
.
pushState
)
{
/*
if (window.history && window.history.pushState) {
// 往历史记录里面添加一条新的当前页面的url
history.pushState(null, null, document.URL)
// 给 popstate 绑定一个方法 监听页面刷新
window.addEventListener('popstate', function(){
hlsPopup.showLongCenter('请点击左上角返回按钮返回')
}, false) // false阻止默认事件
}
/*document.addEventListener('deviceready', function () {
document.addEventListener('backbutton', function () {
hlsPopup.showLongCenter('请点击左上角返回按钮返回')
}, false)
}, false)*/
}*/
vum
.
$vumPlatform
.
registerBackButtonAction
(
function
(
e
)
{
// let vm = this
...
...
src/pages/myProductCollection/my-product-list.Vue
View file @
7ffc2d8a
...
...
@@ -64,14 +64,7 @@ export default {
created
:
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
()
{
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment