Commit fe6d08a5 authored by linxin's avatar linxin

add

parents 775ee2de 9c9c875a
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<body> <body>
<div id="app-box"></div> <div id="app-box"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<script> <!-- <script>
// if (window.history && window.history.pushState) { // if (window.history && window.history.pushState) {
// // 往历史记录里面添加一条新的当前页面的url // // 往历史记录里面添加一条新的当前页面的url
// history.pushState(null, null, document.URL) // history.pushState(null, null, document.URL)
...@@ -32,18 +32,18 @@ ...@@ -32,18 +32,18 @@
// alert('请点击左上角返回按钮返回') // alert('请点击左上角返回按钮返回')
// }, false) // false阻止默认事件 // }, false) // false阻止默认事件
// } // }
const u = navigator.userAgent; // const u = navigator.userAgent;
if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) { //安卓手机 // if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) { //安卓手机
window.addEventListener('resize', function () { // window.addEventListener('resize', function () {
// Document 对象的activeElement 属性返回文档中当前获得焦点的元素。 // // Document 对象的activeElement 属性返回文档中当前获得焦点的元素。
if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') { // if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') {
console.log('安卓触发', document.activeElement.tagName) // console.log('安卓触发', document.activeElement.tagName)
window.setTimeout(function() { // window.setTimeout(function() {
document.activeElement.scrollIntoView(false); // document.activeElement.scrollIntoView(true);
}, 50); // }, 50);
} // }
}) // })
} // }
</script> </script> -->
</body> </body>
</html> </html>
...@@ -182,7 +182,19 @@ vum.$vumPlatform.registerBackButtonAction(function (e) { ...@@ -182,7 +182,19 @@ vum.$vumPlatform.registerBackButtonAction(function (e) {
e.preventDefault() e.preventDefault()
return false return false
}, 101) }, 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 */ /* eslint-disable no-new */
new Vue({ new Vue({
data () { data () {
......
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