data中放入
footer:0,
showHeight: window.innerHeight, //浏览器显示窗口
解决思路:
主要是display:none样式来动态实现他的显示与隐藏,需放入mounted: function mounted() {}函数中监听
mounted: function mounted() {
var that = this;
window.onresize = function() {
if(that.showHeight != window.innerHeight){
//当软键盘弹起,在此处操作
console.log("软键盘弹起")
that.footer = 1
}else{
//当软键盘收起,在此处操作
that.footer = 0
console.log("软键盘收起")
}
}
}
html: <footer :class="{none:footer}"></footer>