@confirm="clickBarSend()" confirm-type="send"
@keyboardheightchange="chatKeyboardHeightChange($event)" auto-height />
watch: {
chatValue(txt) {
if (/\n$/.test(txt)) { //敲了回车键了
this.clickBarSend()
this.chatValue = ''
}
}
},
//发送信息
clickBarSend(){
},
chatFocusChange: function(e) {
let that = this
if (that.popupLayerOpen == true) {
// setTimeout(function(){
that.popupLayerOpen = false
that.heizj = 1
that.scrollHeight=that.scrollHeight uni.upx2px(190)
// that.scrollHeight=that.scrollHeight uni.upx2px(190)
// },300)
that.$forceUpdate()
}
that.chatFocus=true
// #ifdef APP-PLUS
this.keyboardHeight = e.detail.height;
if(this.emojiOpen ){
this.topHeight=e.detail.height-150
}else{
this.topHeight=e.detail.height
}
// #endif
setTimeout(function() {
const el = that.$refs.listBottom
dom.scrollToElement(el, {})
}, 0)
},
//失去焦点
chatBlurChange: function(e) {
let that = this
if (that.heizj) {
// that.scrollHeight = that.scrollHeight - uni.upx2px(190)
setTimeout(function() {
that.scrollToBottom();
}, 0);
}
this.heizj = ''
that.chatFocus=false
this.keyboardHeight = 0;
this.topHeight=0
setTimeout(function() {
const el = that.$refs.listBottom
dom.scrollToElement(el, {})
}, 100)
},
//编辑消息
chatWrite: function(e) {
this.chatValue = e.detail.value;
let that=this,bhgd=0
var query = uni.createSelectorQuery().in(this);
query.select('#textarea').boundingClientRect();
query.exec(data => {
bhgd=data[0].height-that.srkgd
if(that.srkgd!=0){
that.scrollHeight=that.scrollHeight - bhgd
setTimeout(function() {
that.scrollToBottom();
}, 0);
}
that.srkgd=data[0].height
});
}
1 个回复
小白请指教 (作者) - 小白一个
nvue文件无法上传 改为txt上传代码