Commit 64857295 by 展昭

parseInt(barHeight);

parent c8e40d92
const setBarHeight = { const setBarHeight = {
mounted() { mounted() {
const barHeight = localStorage.getItem('barHeight'); const barHeight = localStorage.getItem('barHeight');
const conHeight = 46 + barHeight; const conHeight = 46 + parseInt(barHeight);
console.log('mixins barHeight=', barHeight); console.log('mixins barHeight=', barHeight);
// const dom = document.getElementsByClassName("iosStyle")[0]; const dom = document.getElementsByClassName("iosStyle")[0];
// if (dom) { if (dom) {
// dom.setAttribute("style", "padding-top:" + barHeight + "px !important"); dom.setAttribute("style", "padding-top:" + barHeight + "px !important");
// } }
// const dom2 = document.getElementsByClassName("container")[0]; const dom2 = document.getElementsByClassName("container")[0];
// if (dom2) { if (dom2) {
// dom2.setAttribute("style", "padding-top:" + conHeight + "px !important"); dom2.setAttribute("style", "padding-top:" + conHeight + "px !important");
// } }
} }
} }
......
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
}, },
setBarHeight() { setBarHeight() {
const barHeight = localStorage.getItem("barHeight"); const barHeight = localStorage.getItem("barHeight");
const conHeight = 46 + barHeight; const conHeight = 46 + parseInt(barHeight);
console.log("setBarHeight conHeight=", conHeight); console.log("setBarHeight conHeight=", conHeight);
const dom = document.getElementsByClassName("iosStyle")[0]; const dom = document.getElementsByClassName("iosStyle")[0];
if (dom) { if (dom) {
...@@ -123,7 +123,6 @@ export default { ...@@ -123,7 +123,6 @@ export default {
} }
const dom2 = document.getElementsByClassName("temp-container")[0]; const dom2 = document.getElementsByClassName("temp-container")[0];
console.log("dom2=", dom2);
if (dom2) { if (dom2) {
dom2.setAttribute("style","padding-top:" + conHeight + "px !important" dom2.setAttribute("style","padding-top:" + conHeight + "px !important"
); );
......
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 sign in to comment