diff --git a/pages/chat/SliceMsgToLastMsg.js b/pages/chat/SliceMsgToLastMsg.js index 49ae543c38641b0cdb996cfcc8daf9cc0926ac42..70629d034697b18cf734243061a3c9dd69ad139e 100644 --- a/pages/chat/SliceMsgToLastMsg.js +++ b/pages/chat/SliceMsgToLastMsg.js @@ -27,7 +27,7 @@ export default class SliceMsgToLastMsg { return //console.log('被终止'); } this.sliceMsgIng = true - const msgsArr = this.msgs.split(/(?<=\p{Script=Han})|(?=\p{Script=Han})/gu); + const msgsArr = this.msgs.match(/[\p{Script=Han}]|[^\p{Script=Han}]+/gu); let msg = msgsArr.reverse().pop() // console.log('msg', msg); // 更新最后一条消息的内容