diff --git a/README.md b/README.md index debeafdec467b4f9a42a9064703350d2bf50a5df..c8cff4417b2f96f16e137260b8fbab0b70cbb507 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@
@@ -69,8 +69,7 @@ #### 跟新公告 -- `+ 新增` 快捷回复,返回对象属性 -- `/ 修复` 切换窗口滚动失效 +- `+ 新增` 完成文件显示 #### 参与贡献 diff --git a/package.json b/package.json index 212133fb7209df88681270c3e0d8913f939b9bc2..90b4a9cb21bd6b41ab41ffaac7b869a6ea53da17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jwchat", - "version": "0.3.5", + "version": "0.3.6", "description": "vue chat commponent", "main": "lib/JwChat.umd.min.js", "private": false, diff --git a/src/components/Chat/itemTalk.vue b/src/components/Chat/itemTalk.vue index 6a8d38c8a37a68db773f2476c93f91b444ccf528..b0d2a18d837ee818c9aa35feecb5dd267f5f30ea 100644 --- a/src/components/Chat/itemTalk.vue +++ b/src/components/Chat/itemTalk.vue @@ -72,15 +72,19 @@ export default { computed: { getTag () { const str = this.text || "" - let tag = 'span' - let type = '' - - const isTag = str.match(/(?<=^<)[A-Z|a-z]+/) - isTag && (type = isTag[0]) - if (this.tags.includes(type)) { - tag = type - } - return tag + console.log(this.text) + let tag = "span" + let type = "" + let _str = "" + if (str.match(/<\/?[^>]+>/)) { + _str = str.match(/<\/?[^>]+>/)[0] + } + let isTag = _str.split(" ")[0].replace(/<|>/, "") || "" + isTag && (type = isTag) + if (this.tags.includes(type)) { + tag = type + } + return tag }, getData () { const str = this.text || ""