stellar-ui-plus 1.24.13 → 1.24.14
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/package.json +1 -1
- package/utils/mixin.ts +5 -8
package/package.json
CHANGED
package/utils/mixin.ts
CHANGED
|
@@ -12,13 +12,6 @@ type ParentProvide<T> = T & {
|
|
|
12
12
|
internalChildren: SelfComponentInternalInstance[]
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
// 预创建共享的默认返回值,避免每次调用都创建新对象
|
|
16
|
-
const defaultInjectReturn = {
|
|
17
|
-
parent: null,
|
|
18
|
-
index: ref(-1),
|
|
19
|
-
instance: null,
|
|
20
|
-
}
|
|
21
|
-
|
|
22
15
|
export function useInject<T>(key: InjectionKey<ParentProvide<T>>, selfValue: Obj = {}) {
|
|
23
16
|
const parent = inject(key, null)
|
|
24
17
|
if (parent) {
|
|
@@ -40,7 +33,11 @@ export function useInject<T>(key: InjectionKey<ParentProvide<T>>, selfValue: Obj
|
|
|
40
33
|
}
|
|
41
34
|
}
|
|
42
35
|
|
|
43
|
-
return
|
|
36
|
+
return {
|
|
37
|
+
parent: null,
|
|
38
|
+
index: ref(-1),
|
|
39
|
+
instance: null,
|
|
40
|
+
}
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
// TODO: uniapp 不支持 vue 直接导出的 isVNode
|