你好,关于input聚焦问题,点击按钮显示隐藏的input并且弹出键盘;
6***@qq.com
- 发布:2019-01-18 11:03
- 更新:2019-01-18 15:15
- 阅读:3129
问题:input聚焦后,弹出软键盘,又自动关闭,什么原因?
分类:uni-app
虫雪浓 - 热爱生活,热爱编程
关键代码修改如下:
<view class="BtoNav uni-flex uni-row" v-show="inputc" style="width: 96%; left: 2%;">
<input class="uni-input" confirm-type="send" :focus="inputc" placeholder="请输入" />
</view>
6***@qq.com (作者)
代码如下:
<template>
<view>
<view class="uni-flex uni-row header">
<view class="grace-iconfont icon-arrow-left" style="width: 80upx; margin-left: 20upx;" @tap="back()"></view>
<view class="grace-center" style="flex: 1; display: block;">回复/拒绝</view>
</view>
<view class="background-g formSyle" style="margin-top: 110upx;">
<view class="mainPad grace-slide-do" style="border:0; padding:16upx 3%;">
<view class="BtoNav uni-flex uni-row" v-if="inputc" style="width: 96%; left: 2%;">
<input class="uni-input" confirm-type="send" focus placeholder="请输入" />
</view>
<view class="BtoNav uni-flex uni-row" v-if="!inputc">
<view class="text background-f grace-center border-top font-color-true" @tap="communicate('false')" style="width: 50%; font-size:32upx; color: red;">拒绝</view>
<view class="text back-color-true grace-center" style="flex: 1; font-size:32upx" @tap="communicate('true')">回复</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
inputc:false,
focus: false,
id: '',
};
},
onLoad: function(option){
},
methods:{
communicate: function(type) {
this.inputc = true;
console.log("type:",type)
},
back: function() {
},
}
}
</script>
<style>
</style>
2019-01-18 13:12