提交 e88830fd 编写于 作者: DCloud_JSON's avatar DCloud_JSON

Update chat.nvue

上级 f15b31e3
...@@ -606,13 +606,13 @@ ...@@ -606,13 +606,13 @@
if(this.isWidescreen || this.watchChatInputContentDisabled === true){ if(this.isWidescreen || this.watchChatInputContentDisabled === true){
return return
} }
console.log('chatInputContent',newValue,oldValue); // console.log('chatInputContent',newValue,oldValue);
// 截流调用 chatInputContentAfter 方法 // 截流调用 chatInputContentAfter 方法
if(this.doChatInputContentAfter){ if(this.doChatInputContentAfter){
clearTimeout(this.doChatInputContentAfter) clearTimeout(this.doChatInputContentAfter)
} }
this.doChatInputContentAfter = setTimeout(() => { this.doChatInputContentAfter = setTimeout(() => {
console.error('chatInputContent#6'); // console.error('chatInputContent#6');
this.lockDoChatInputContentAfter = false this.lockDoChatInputContentAfter = false
this.chatInputContentAfter(newValue, oldValue) this.chatInputContentAfter(newValue, oldValue)
}, 300); }, 300);
...@@ -692,7 +692,7 @@ ...@@ -692,7 +692,7 @@
// #endif // #endif
}, },
chatInputContentAfter(newValue, oldValue){ chatInputContentAfter(newValue, oldValue){
console.log('chatInputContentAfter',newValue,oldValue); // console.log('chatInputContentAfter',newValue,oldValue);
currentCursor = -1 currentCursor = -1
// 先找到字符不同的位置,即为光标操作时的位置 // 先找到字符不同的位置,即为光标操作时的位置
for (let i = 0; i < newValue.length; i++) { for (let i = 0; i < newValue.length; i++) {
...@@ -707,7 +707,7 @@ ...@@ -707,7 +707,7 @@
// console.log('cursor光标的位置',currentCursor,newValue,'newValue'); // console.log('cursor光标的位置',currentCursor,newValue,'newValue');
let isAdd = newValue.length > oldValue.length let isAdd = newValue.length > oldValue.length
let changeValue = isAdd ? newValue[currentCursor] : oldValue[currentCursor] let changeValue = isAdd ? newValue[currentCursor] : oldValue[currentCursor]
console.log('changeValue变化的内容',changeValue); // console.log('changeValue变化的内容',changeValue);
if(changeValue == '@'){ if(changeValue == '@'){
this.showAboutUidBox = isAdd this.showAboutUidBox = isAdd
if(isAdd){ if(isAdd){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册