151
rated 0 times
[
153]
[
2]
/ answers: 1 / hits: 179074
/ 7 Years ago, fri, november 10, 2017, 12:00:00
In my mobile web app with Vue, I want to hide my footer when the soft keyboard pops. So I have a little function to test the ratio of window height to window width...
showFooter(){
return h / w > 1.2 || h > 560;
}
...and I declare window.innerHeight/window.innerWidth in my data.
data: { h: window.innerHeight, w: window.innerWidth }
Trouble is, when window.innerHeight changes, my h property doesn't get the new value. How can I watch window.innerHeight ?
More From » vue.js