<div class="main">
<div class="chat-content" id="chat-content">
</div>
<div class="chat-ques">
<div contenteditable="true" class="input" v-text="inputData" ref="input" @input="changeText">
</div>
<div class="send">发送</div>
</div>
</div>
changeText(){
if(this.$refs.input.innerText.trim()){
this.isShowSendBtn = true
}else{
this.isShowSendBtn = false
}
}
send(){
some code........
// h5 ios移动端,键盘收起以后页面不归位
window.scroll(0,0);
}
.main{
height: 100vh;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.chat-content {
background-color: #edf2f6;
width: 100%;
overflow-y: scroll;
flex:1;
}
.chat-ques{
width: 100%;
padding:15px;
}
.send{
float: right;
width: 50px;
height: 28px;
line-height: 28px;
border-radius: 5px;
color:#fff;
background:#07C160;
border: 1px solid #ccc;
text-align: center;
margin-top: 1px;
}
.input{
float: left;
width: calc(100% - 60px);
height: auto;
max-height: 90px;
min-height: 30px;
overflow-y: scroll;
line-height: 30px;
border: 1px solid #ccc;
border-radius: 5px;
padding: 0 10px;
}
div模拟微信输入效果
最新推荐文章于 2023-01-02 16:59:44 发布