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
9c9c875a
Commit
9c9c875a
authored
Mar 25, 2020
by
linxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
ba80ccf2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
15 deletions
+27
-15
index.html
index.html
+14
-14
main.js
src/main.js
+13
-1
No files found.
index.html
View file @
9c9c875a
...
...
@@ -22,7 +22,7 @@
<body>
<div
id=
"app-box"
></div>
<!-- built files will be auto injected -->
<script>
<
!-- <
script>
// if (window.history && window.history.pushState) {
// // 往历史记录里面添加一条新的当前页面的url
// history.pushState(null, null, document.URL)
...
...
@@ -32,18 +32,18 @@
// alert('请点击左上角返回按钮返回')
// }, false) // false阻止默认事件
// }
const
u
=
navigator
.
userAgent
;
if
(
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Linux'
)
>
-
1
)
{
//安卓手机
window
.
addEventListener
(
'resize'
,
function
()
{
// Document 对象的activeElement 属性返回文档中当前获得焦点的元素。
if
(
document
.
activeElement
.
tagName
===
'INPUT'
||
document
.
activeElement
.
tagName
===
'TEXTAREA'
)
{
console
.
log
(
'安卓触发'
,
document
.
activeElement
.
tagName
)
window
.
setTimeout
(
function
()
{
document
.
activeElement
.
scrollIntoView
(
true
);
},
50
);
}
})
}
</script>
//
const u = navigator.userAgent;
//
if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) { //安卓手机
//
window.addEventListener('resize', function () {
//
// Document 对象的activeElement 属性返回文档中当前获得焦点的元素。
//
if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') {
//
console.log('安卓触发', document.activeElement.tagName)
//
window.setTimeout(function() {
//
document.activeElement.scrollIntoView(true);
//
}, 50);
//
}
//
})
//
}
</script>
-->
</body>
</html>
src/main.js
View file @
9c9c875a
...
...
@@ -181,7 +181,19 @@ vum.$vumPlatform.registerBackButtonAction(function (e) {
e
.
preventDefault
()
return
false
},
101
)
// input遮挡
const
u
=
navigator
.
userAgent
if
(
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Linux'
)
>
-
1
)
{
// 安卓手机
window
.
addEventListener
(
'resize'
,
function
()
{
// Document 对象的activeElement 属性返回文档中当前获得焦点的元素。
if
(
document
.
activeElement
.
tagName
===
'INPUT'
||
document
.
activeElement
.
tagName
===
'TEXTAREA'
)
{
console
.
log
(
'安卓触发'
,
document
.
activeElement
.
tagName
)
window
.
setTimeout
(
function
()
{
document
.
activeElement
.
scrollIntoView
(
true
)
},
50
)
}
})
}
/* eslint-disable no-new */
new
Vue
({
data
()
{
...
...
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