im-ui-mobile 0.0.67 → 0.0.68
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.
- package/index.js +14 -4
- package/package.json +1 -1
- package/types/index.d.ts +13 -2
package/index.js
CHANGED
|
@@ -43,7 +43,7 @@ let globalConfig = {
|
|
|
43
43
|
emojiUrl: '',
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
const install = (app,
|
|
46
|
+
const install = (app, upuiParams = '') => {
|
|
47
47
|
// 合并配置
|
|
48
48
|
globalConfig = { ...globalConfig, ...options };
|
|
49
49
|
|
|
@@ -52,11 +52,21 @@ const install = (app, options = {}) => {
|
|
|
52
52
|
emoji.setEmojiUrl(globalConfig.emojiUrl);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
// 配置
|
|
56
|
+
if (upuiParams) {
|
|
57
|
+
uni.upuiParams = upuiParams
|
|
58
|
+
const temp = upuiParams()
|
|
59
|
+
if (temp.options) {
|
|
60
|
+
setConfig(temp.options)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
55
64
|
// 提供全局配置
|
|
56
65
|
app.provide('im-config', options.config || {})
|
|
57
66
|
|
|
67
|
+
|
|
58
68
|
// 安装插件
|
|
59
|
-
|
|
69
|
+
|
|
60
70
|
// // 安装pinia插件
|
|
61
71
|
// if (options.usePinia !== false) {
|
|
62
72
|
// app.use(PiniaPlugin, options.piniaOptions)
|
|
@@ -74,8 +84,8 @@ const install = (app, options = {}) => {
|
|
|
74
84
|
// 导出安装函数和配置方法
|
|
75
85
|
const setConfig = (options) => {
|
|
76
86
|
Object.assign(globalConfig, options);
|
|
77
|
-
if (options.
|
|
78
|
-
emoji.setEmojiUrl(options.
|
|
87
|
+
if (options.emoji && options.emoji.baseUrl) {
|
|
88
|
+
emoji.setEmojiUrl(options.emoji.baseUrl);
|
|
79
89
|
}
|
|
80
90
|
};
|
|
81
91
|
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import eventBus from "./utils/eventBus.d.ts";
|
|
4
4
|
import datetime from "./utils/datetime.d.ts";
|
|
5
5
|
import Emoji from "./utils/emoji.d.ts";
|
|
6
|
-
import {emoji} from "./utils/emoji.d.ts";
|
|
6
|
+
import { emoji } from "./utils/emoji.d.ts";
|
|
7
7
|
import { MESSAGE_TYPE, RTC_STATE, TERMINAL_TYPE, MESSAGE_STATUS } from "./utils/enums.d.ts";
|
|
8
8
|
import * as dom from "./utils/dom.d.ts";
|
|
9
9
|
import messageType from "./utils/messageType.d.ts";
|
|
@@ -13,7 +13,7 @@ import Requester from "./utils/requester.d.ts";
|
|
|
13
13
|
import * as url from "./utils/url.d.ts";
|
|
14
14
|
import { useDynamicRefs } from "./utils/useDynamicRefs.d.ts";
|
|
15
15
|
import WebSocket from "./utils/websocket.d.ts";
|
|
16
|
-
import {webSocket} from "./utils/websocket.d.ts";
|
|
16
|
+
import { webSocket } from "./utils/websocket.d.ts";
|
|
17
17
|
import type {
|
|
18
18
|
// 类型常量
|
|
19
19
|
RtcMode,
|
|
@@ -42,7 +42,18 @@ import type {
|
|
|
42
42
|
declare module 'im-ui-mobile' {
|
|
43
43
|
export function install(): void
|
|
44
44
|
|
|
45
|
+
interface EmojiConfig {
|
|
46
|
+
baseUrl: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface GlobalConfig {
|
|
50
|
+
emoji: Partial<EmojiConfig>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function setConfig(config: Partial<GlobalConfig>): void;
|
|
54
|
+
|
|
45
55
|
export {
|
|
56
|
+
ImUiConfig,
|
|
46
57
|
eventBus,
|
|
47
58
|
datetime,
|
|
48
59
|
Emoji,
|