im-ui-mobile 0.0.72 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
<im-long-press-menu :items="menuItems" @select="onSelectMenu">
|
|
20
20
|
<!-- up-parse支持点击a标签,但是不支持显示emo表情,也不支持换行 -->
|
|
21
21
|
<up-parse
|
|
22
|
-
v-if="$url.containUrl(msgInfo.content) && !$
|
|
23
|
-
class="message-text" :showImgMenu="false" :content="nodesText"
|
|
22
|
+
v-if="$url.containUrl(msgInfo.content) && !$emoji.containEmoji(msgInfo.content)"
|
|
23
|
+
class="message-text" :showImgMenu="false" :content="nodesText" />
|
|
24
24
|
<!-- rich-text支持显示emo表情以及消息换行,但是不支持点击a标签 -->
|
|
25
|
-
<rich-text v-else class="message-text" :nodes="nodesText"
|
|
25
|
+
<rich-text v-else class="message-text" :nodes="nodesText" />
|
|
26
26
|
</im-long-press-menu>
|
|
27
27
|
</view>
|
|
28
28
|
<view class="message-image" v-else-if="msgInfo.type == MESSAGE_TYPE.IMAGE">
|
|
@@ -113,7 +113,7 @@ interface Emits {
|
|
|
113
113
|
(e: 'download', msgInfo: any): void;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
const $
|
|
116
|
+
const $emoji = emoji
|
|
117
117
|
const $url = url
|
|
118
118
|
const $datetime = datetime
|
|
119
119
|
const props = defineProps<Props>();
|
package/index.js
CHANGED
|
@@ -50,11 +50,12 @@ const install = (app, options = {}) => {
|
|
|
50
50
|
config = { ...defaultConfig, ...options }
|
|
51
51
|
|
|
52
52
|
// 提供全局配置
|
|
53
|
-
app.provide('im-config',
|
|
53
|
+
app.provide('im-config', config)
|
|
54
54
|
|
|
55
55
|
// 应用配置到各个模块
|
|
56
56
|
if (config.emojiUrl) {
|
|
57
57
|
// 设置 emoji 模块
|
|
58
|
+
console.log('设置 emoji 模块', config)
|
|
58
59
|
emoji.setEmojiUrl(config.emojiUrl);
|
|
59
60
|
}
|
|
60
61
|
|
package/package.json
CHANGED
package/utils/emoji.js
CHANGED
|
@@ -8,8 +8,11 @@ class Emoji {
|
|
|
8
8
|
* @param {string} options.emojiUrl - 表情图片基础URL
|
|
9
9
|
*/
|
|
10
10
|
constructor(options = {}) {
|
|
11
|
+
const config = inject('im-config')
|
|
12
|
+
console.log('config', config)
|
|
13
|
+
|
|
11
14
|
// 表情图片基础URL
|
|
12
|
-
this.emojiUrl = options.emojiUrl ||
|
|
15
|
+
this.emojiUrl = options.emojiUrl || config?.emojiUrl;
|
|
13
16
|
|
|
14
17
|
// 表情文本列表
|
|
15
18
|
this.emoTextList = [
|