1.方法
// 控制底部logou的显示与隐藏
getKeyboardState() {
this.monitorKeyboard = new MonitorKeyboard();
this.monitorKeyboard.onStart();
// 监听虚拟键盘弹出事件
this.monitorKeyboard.onShow(() => {
this.footshow = false;
});
//监听键盘收起的事件
this.monitorKeyboard.onHidden(() => {
this.footshow = true;
});
},
离开调用
mounted() {
this.getKeyboardState();
},
beforeDestroy() {
this.monitorKeyboard.onEnd();
},
注意:离开页面记得销毁 beforeDestroy