mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 19:23:26 +00:00
perf: 优化发送图片出现空白的情况
This commit is contained in:
parent
9d14123a66
commit
d013ab1e3c
@ -875,11 +875,12 @@ export default {
|
|||||||
*/
|
*/
|
||||||
sendMsg(text) {
|
sendMsg(text) {
|
||||||
let msgText;
|
let msgText;
|
||||||
|
let emptied = false;
|
||||||
if (typeof text === "string" && text) {
|
if (typeof text === "string" && text) {
|
||||||
msgText = text;
|
msgText = text;
|
||||||
} else {
|
} else {
|
||||||
msgText = this.msgText;
|
msgText = this.msgText;
|
||||||
this.msgText = '';
|
emptied = true;
|
||||||
}
|
}
|
||||||
if (msgText == '') {
|
if (msgText == '') {
|
||||||
this.inputFocus();
|
this.inputFocus();
|
||||||
@ -928,7 +929,6 @@ export default {
|
|||||||
text: typeLoad ? '' : msgText,
|
text: typeLoad ? '' : msgText,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
setTimeout(_ => {
|
|
||||||
this.tempMsgs.push(tempMsg)
|
this.tempMsgs.push(tempMsg)
|
||||||
this.msgType = ''
|
this.msgType = ''
|
||||||
this.replyActiveId = 0
|
this.replyActiveId = 0
|
||||||
@ -958,7 +958,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}, 10)
|
}
|
||||||
|
if (emptied) {
|
||||||
|
requestAnimationFrame(_ => this.msgText = '')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user