Commit 8af9bd80 by zhangxw

键盘弹起页面高度问题

1 parent 6338c2be
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0" id="viewportMeta">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title> <title>
<%= htmlWebpackPlugin.options.title %> <%= htmlWebpackPlugin.options.title %>
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
} }
html, html,
body { body {
height: 100%; height: 100vh;
// min-height: 100%; // min-height: 100%;
// min-height: 100%; // min-height: 100%;
} }
......
...@@ -223,7 +223,22 @@ export default defineComponent({ ...@@ -223,7 +223,22 @@ export default defineComponent({
window.AMap = AMap; window.AMap = AMap;
mapContentRefs.value.initMap("container"); mapContentRefs.value.initMap("container");
}); });
var realHeight =
window.innerWidth > window.innerHeight
? window.innerWidth
: window.innerHeight;
initViewport(realHeight);
}); });
const initViewport = (height) => {
var metaEl = document.querySelector("#viewportMeta");
console.log(metaEl);
var content =
"height=" +
height +
",width=device-width,initial-scale=1.0,user-scalable=no";
metaEl.setAttribute("name", "viewport");
metaEl.setAttribute("content", content);
};
const checkIsShareDead = (id) => { const checkIsShareDead = (id) => {
if (_timeoutId) { if (_timeoutId) {
clearTimeout(_timeoutId); clearTimeout(_timeoutId);
...@@ -620,6 +635,7 @@ export default defineComponent({ ...@@ -620,6 +635,7 @@ export default defineComponent({
routeQuery, routeQuery,
ISLOADING, ISLOADING,
showOverlay, showOverlay,
initViewport,
}; };
}, },
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!