<textarea v-model="msg" :show-confirm-bar="false" :cursor-spacing="10" class="itl-area n-flex-1"
placeholder="总要说点什么吧" :style="'height:'+areaHeight+'px;'" :maxlength="1000" :adjust-position="true"
confirm-type="send" @linechange="toChangeLine" @confirm="toConfirm"></textarea>
js部分
watch: {
msg(txt) {
if (txt.indexOf('\n') != -1) { //敲了回车键了
console.log("按了回车键盘")
const stripHTMLTags = txt.replace(/]*>/g, '');
this.$emit("confirm", stripHTMLTags.trim())
uni.hideKeyboard() //收起软键盘
this.$nextTick(() => {
this.msg = ''
})
}
}
},
2***@qq.com (作者)
按了发送没有触发msg watcher, 并且软键盘收起了
2022-04-27 13:54
2***@qq.com (作者)
最新版本的已修复,可以了
2022-04-27 13:55