From 59b46369f3cab47ef5bf131902b4f55c23a60626 Mon Sep 17 00:00:00 2001 From: vilson <545522390@qq.com> Date: Sat, 17 Aug 2019 19:29:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/project/taskDetail.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/project/taskDetail.vue b/src/components/project/taskDetail.vue index 613beae..2165ae8 100644 --- a/src/components/project/taskDetail.vue +++ b/src/components/project/taskDetail.vue @@ -1604,12 +1604,15 @@ } comment += ' '; const regx = /(@[^@]+) /g; - comment.match(regx).forEach((v) => { - let str = v.substring(1, v.length - 1); - if (this.mentionsList.findIndex(item => item == str) === -1) { - this.mentionsList.push(str); - } - }); + const res = comment.match(regx); + if (res) { + res.forEach((v) => { + let str = v.substring(1, v.length - 1); + if (this.mentionsList.findIndex(item => item == str) === -1) { + this.mentionsList.push(str); + } + }); + } createComment(this.code, this.comment, JSON.stringify(this.mentionsList)).then(() => { this.comment = ''; this.mentionsList = [];