// 结构
<div class="foother" v-if="showBtn">
<button>提交</button>
</div>
data () {
return {
clientHeight: document.documentElement.clientHeight,
showBtn: true,
}
}
mounted() {
window.onresize= ()=>{
if(this.clientHeight>document.documentElement.clientHeight) {
this.showBtn =false
}else{
this.showBtn = true
}
}
}
VUE H5文本框获取焦点唤起键盘时,绝对定位的元素被键盘顶上去的问题解决方案
最新推荐文章于 2024-03-04 16:28:05 发布
这篇博客探讨了如何在Vue.js应用中利用`v-if`指令进行条件渲染。示例展示了当窗口大小超过特定阈值时,隐藏底部的提交按钮。代码片段涉及到数据属性`showBtn`的更新,以及窗口大小改变时的响应式处理。
6466





