<view class="textarea" id="textarea" :style="[{ height: height }]">
<textarea v-model="txt" :focus="focus" :auto-height="true" class="input" maxlength="1500" placeholder="placeholder" :rows="rows" />
</view>
export default {
data() {
return {
txt: '', //反馈意见
placeholder: '请输入反馈意见', //占位符
rows: 3, //文本域默认显示行数
statusBarHeight: 32,
header_height: 44,
keyheight: 0,
height: 736,
focus: true
};
},
onLoad() {
this.initFullScreen();
},
onReady() {
uni.createSelectorQuery()
.select('#header')
.boundingClientRect(res => {
console.log(res);
this.header_height = res.height;
this.initFullScreen();
})
.exec();
},
methods: {
// 屏幕信息
initFullScreen() {
uni.getSystemInfo({
success: res => {
console.log(res);
this.statusBarHeight = res.statusBarHeight + 'px';
this.height = `calc(100vh - ${res.statusBarHeight + this.header_height + 'px'})`;
console.log(this.height);
// _this.height = `calc(100vh - ${_this.input_height + 'px'})`
}
});
},
}
};

- 发布:2021-11-11 13:19
- 更新:2021-11-25 16:11
- 阅读:712
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 3.2.12
手机系统: Android
手机系统版本号: Android 12
手机厂商: OPPO
手机机型: OPPO A9
页面类型: vue
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
个人中心页(nvue)点击意见反馈按钮,跳转的意见反馈页面(vue)
个人中心页(nvue)点击意见反馈按钮,跳转的意见反馈页面(vue)
预期结果:
进入到意见反馈页面首先获取焦点,弹出软键盘
进入到意见反馈页面首先获取焦点,弹出软键盘
实际结果:
获取到焦点,弹出软键盘,然后失去焦点,隐藏软键盘
获取到焦点,弹出软键盘,然后失去焦点,隐藏软键盘
bug描述:
自动获取焦点,弹出软键盘,然后失去焦点,隐藏软键盘
1 个回复
DCloud_Android_ST
请提供一下完整复现问题的示例项目。只有片段代码无法复现问题