-
-
+
+
{{ msgInfo.content }}
@@ -203,6 +203,11 @@ export default {
isNormal() {
const type = this.msgInfo.type;
return this.$msgType.isNormal(type) || this.$msgType.isAction(type)
+ },
+ htmlText() {
+ let color = this.msgInfo.selfSend ? 'white' : '';
+ let text = this.$url.replaceURLWithHTMLLinks(this.msgInfo.content, color)
+ return this.$emo.transform(text)
}
}
}
@@ -472,4 +477,4 @@ export default {
}
}
-
+
\ No newline at end of file
diff --git a/im-web/src/main.js b/im-web/src/main.js
index 3039ea5..a2ed843 100644
--- a/im-web/src/main.js
+++ b/im-web/src/main.js
@@ -9,6 +9,7 @@ import httpRequest from './api/httpRequest';
import * as socketApi from './api/wssocket';
import * as messageType from './api/messageType';
import emotion from './api/emotion.js';
+import url from './api/url.js';
import element from './api/element.js';
import store from './store';
import * as enums from './api/enums.js';
@@ -22,6 +23,7 @@ Vue.prototype.$msgType = messageType
Vue.prototype.$date = date;
Vue.prototype.$http = httpRequest // http请求方法
Vue.prototype.$emo = emotion; // emo表情
+Vue.prototype.$url = url; // url转换
Vue.prototype.$elm = element; // 元素操作
Vue.prototype.$enums = enums; // 枚举
Vue.prototype.$eventBus = new Vue(); // 全局事件