div模拟微信输入效果

it2022-05-05  123

<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; }

最新回复(0)