Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzj-java
uni-app
提交
e5eb8c38
U
uni-app
项目概览
wzj-java
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e5eb8c38
编写于
12月 15, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(mp): support defineExpose (#3074)
上级
09fb6033
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
100 addition
and
30 deletion
+100
-30
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+9
-2
packages/uni-mp-alipay/src/runtime/util.ts
packages/uni-mp-alipay/src/runtime/util.ts
+2
-1
packages/uni-mp-baidu/dist/uni.mp.esm.js
packages/uni-mp-baidu/dist/uni.mp.esm.js
+10
-3
packages/uni-mp-core/src/index.ts
packages/uni-mp-core/src/index.ts
+1
-0
packages/uni-mp-core/src/runtime/util.ts
packages/uni-mp-core/src/runtime/util.ts
+12
-2
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
+10
-3
packages/uni-mp-lark/dist/uni.mp.esm.js
packages/uni-mp-lark/dist/uni.mp.esm.js
+10
-3
packages/uni-mp-qq/dist/uni.mp.esm.js
packages/uni-mp-qq/dist/uni.mp.esm.js
+10
-3
packages/uni-mp-toutiao/dist/uni.mp.esm.js
packages/uni-mp-toutiao/dist/uni.mp.esm.js
+10
-3
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+3
-2
packages/uni-mp-vue/lib/vue.runtime.esm.js
packages/uni-mp-vue/lib/vue.runtime.esm.js
+3
-2
packages/uni-mp-weixin/dist/uni.mp.esm.js
packages/uni-mp-weixin/dist/uni.mp.esm.js
+10
-3
packages/uni-quickapp-webview/dist/uni.mp.esm.js
packages/uni-quickapp-webview/dist/uni.mp.esm.js
+10
-3
未找到文件。
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
e5eb8c38
import
{
isPlainObject
,
hasOwn
,
isArray
,
capitalize
,
isFunction
,
extend
,
isString
,
camelize
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
toRaw
,
findComponentPropsData
,
updateProps
,
invalidateJob
,
EMPTY_OBJ
,
isRef
,
setTemplateRef
,
pruneComponentPropsCache
}
from
'
vue
'
;
import
{
injectHook
,
ref
,
getExposeProxy
,
toRaw
,
findComponentPropsData
,
updateProps
,
invalidateJob
,
EMPTY_OBJ
,
isRef
,
setTemplateRef
,
pruneComponentPropsCache
}
from
'
vue
'
;
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
...
...
@@ -417,6 +417,13 @@ function initWxsCallMethods(methods, wxsCallMethods) {
};
});
}
function
findRefValue
(
component
)
{
const
vm
=
component
.
$vm
;
if
(
vm
)
{
return
getExposeProxy
(
vm
.
$
)
||
vm
;
}
return
component
;
}
function
findVmByVueId
(
instance
,
vuePid
)
{
// 标准 vue3 中 没有 $children,定制了内核
const
$children
=
instance
.
$children
;
...
...
@@ -728,7 +735,7 @@ function handleRef(ref) {
const
instance
=
this
.
$vm
.
$
;
const
refs
=
instance
.
refs
===
EMPTY_OBJ
?
(
instance
.
refs
=
{})
:
instance
.
refs
;
const
{
setupState
}
=
instance
;
const
refValue
=
ref
.
$vm
||
ref
;
const
refValue
=
findRefValue
(
ref
)
;
if
(
refName
)
{
if
(
isString
(
refName
))
{
refs
[
refName
]
=
refValue
;
...
...
packages/uni-mp-alipay/src/runtime/util.ts
浏览文件 @
e5eb8c38
...
...
@@ -24,6 +24,7 @@ import {
initComponentInstance
,
CreateComponentOptions
,
updateComponentProps
,
findRefValue
,
}
from
'
@dcloudio/uni-mp-core
'
import
{
handleLink
as
handleBaseLink
}
from
'
@dcloudio/uni-mp-weixin
'
...
...
@@ -150,7 +151,7 @@ export function handleRef(this: MPComponentInstance, ref: MPComponentInstance) {
instance
.
refs
===
EMPTY_OBJ
?
(
instance
.
refs
=
{})
:
instance
.
refs
const
{
setupState
}
=
instance
const
refValue
=
ref
.
$vm
||
ref
const
refValue
=
findRefValue
(
ref
as
any
)
if
(
refName
)
{
if
(
isString
(
refName
))
{
refs
[
refName
]
=
refValue
...
...
packages/uni-mp-baidu/dist/uni.mp.esm.js
浏览文件 @
e5eb8c38
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
import
{
injectHook
,
ref
,
nextTick
,
getExposeProxy
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
// lifecycle
// App and Page
...
...
@@ -492,9 +492,16 @@ function selectAllComponents(mpInstance, selector, $refs) {
const
components
=
mpInstance
.
selectAllComponents
(
selector
);
components
.
forEach
((
component
)
=>
{
const
ref
=
component
.
properties
.
uR
;
$refs
[
ref
]
=
component
.
$vm
||
component
;
$refs
[
ref
]
=
findRefValue
(
component
)
;
});
}
function
findRefValue
(
component
)
{
const
vm
=
component
.
$vm
;
if
(
vm
)
{
return
getExposeProxy
(
vm
.
$
)
||
vm
;
}
return
component
;
}
function
initRefs
(
instance
,
mpInstance
)
{
Object
.
defineProperty
(
instance
,
'
refs
'
,
{
get
()
{
...
...
@@ -509,7 +516,7 @@ function initRefs(instance, mpInstance) {
if
(
!
$refs
[
ref
])
{
$refs
[
ref
]
=
[];
}
$refs
[
ref
].
push
(
component
.
$vm
||
component
);
$refs
[
ref
].
push
(
findRefValue
(
component
)
);
});
return
$refs
;
},
...
...
packages/uni-mp-core/src/index.ts
浏览文件 @
e5eb8c38
...
...
@@ -38,6 +38,7 @@ export {
fixProperties
,
nextSetDataTick
,
initSetRef
,
findRefValue
,
}
from
'
./runtime/util
'
// protocols
...
...
packages/uni-mp-core/src/runtime/util.ts
浏览文件 @
e5eb8c38
...
...
@@ -5,6 +5,8 @@ import {
ComponentPublicInstance
,
nextTick
,
}
from
'
vue
'
// @ts-ignore
import
{
getExposeProxy
}
from
'
vue
'
import
{
MPComponentInstance
,
MPComponentOptions
}
from
'
./component
'
...
...
@@ -65,10 +67,18 @@ function selectAllComponents(
const
components
=
mpInstance
.
selectAllComponents
(
selector
)
components
.
forEach
((
component
)
=>
{
const
ref
=
component
.
properties
.
uR
$refs
[
ref
]
=
component
.
$vm
||
component
$refs
[
ref
]
=
findRefValue
(
component
as
MPComponentInstance
)
})
}
export
function
findRefValue
(
component
:
MPComponentInstance
)
{
const
vm
=
component
.
$vm
if
(
vm
)
{
return
getExposeProxy
(
vm
.
$
)
||
vm
}
return
component
}
export
function
initRefs
(
instance
:
ComponentInternalInstance
,
mpInstance
:
MPComponentInstance
...
...
@@ -86,7 +96,7 @@ export function initRefs(
if
(
!
$refs
[
ref
])
{
$refs
[
ref
]
=
[]
}
$refs
[
ref
].
push
(
component
.
$vm
||
component
)
$refs
[
ref
].
push
(
findRefValue
(
component
as
MPComponentInstance
)
)
})
return
$refs
},
...
...
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
浏览文件 @
e5eb8c38
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
import
{
injectHook
,
ref
,
nextTick
,
getExposeProxy
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
...
...
@@ -487,9 +487,16 @@ function selectAllComponents(mpInstance, selector, $refs) {
const
components
=
mpInstance
.
selectAllComponents
(
selector
);
components
.
forEach
((
component
)
=>
{
const
ref
=
component
.
properties
.
uR
;
$refs
[
ref
]
=
component
.
$vm
||
component
;
$refs
[
ref
]
=
findRefValue
(
component
)
;
});
}
function
findRefValue
(
component
)
{
const
vm
=
component
.
$vm
;
if
(
vm
)
{
return
getExposeProxy
(
vm
.
$
)
||
vm
;
}
return
component
;
}
function
initRefs
(
instance
,
mpInstance
)
{
Object
.
defineProperty
(
instance
,
'
refs
'
,
{
get
()
{
...
...
@@ -504,7 +511,7 @@ function initRefs(instance, mpInstance) {
if
(
!
$refs
[
ref
])
{
$refs
[
ref
]
=
[];
}
$refs
[
ref
].
push
(
component
.
$vm
||
component
);
$refs
[
ref
].
push
(
findRefValue
(
component
)
);
});
return
$refs
;
},
...
...
packages/uni-mp-lark/dist/uni.mp.esm.js
浏览文件 @
e5eb8c38
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
,
isObject
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
import
{
injectHook
,
ref
,
nextTick
,
getExposeProxy
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
...
...
@@ -486,9 +486,16 @@ function selectAllComponents(mpInstance, selector, $refs) {
const
components
=
mpInstance
.
selectAllComponents
(
selector
);
components
.
forEach
((
component
)
=>
{
const
ref
=
component
.
properties
.
uR
;
$refs
[
ref
]
=
component
.
$vm
||
component
;
$refs
[
ref
]
=
findRefValue
(
component
)
;
});
}
function
findRefValue
(
component
)
{
const
vm
=
component
.
$vm
;
if
(
vm
)
{
return
getExposeProxy
(
vm
.
$
)
||
vm
;
}
return
component
;
}
function
initRefs
(
instance
,
mpInstance
)
{
Object
.
defineProperty
(
instance
,
'
refs
'
,
{
get
()
{
...
...
@@ -503,7 +510,7 @@ function initRefs(instance, mpInstance) {
if
(
!
$refs
[
ref
])
{
$refs
[
ref
]
=
[];
}
$refs
[
ref
].
push
(
component
.
$vm
||
component
);
$refs
[
ref
].
push
(
findRefValue
(
component
)
);
});
return
$refs
;
},
...
...
packages/uni-mp-qq/dist/uni.mp.esm.js
浏览文件 @
e5eb8c38
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
import
{
injectHook
,
ref
,
getExposeProxy
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
...
...
@@ -483,9 +483,16 @@ function selectAllComponents(mpInstance, selector, $refs) {
const
components
=
mpInstance
.
selectAllComponents
(
selector
);
components
.
forEach
((
component
)
=>
{
const
ref
=
component
.
properties
.
uR
;
$refs
[
ref
]
=
component
.
$vm
||
component
;
$refs
[
ref
]
=
findRefValue
(
component
)
;
});
}
function
findRefValue
(
component
)
{
const
vm
=
component
.
$vm
;
if
(
vm
)
{
return
getExposeProxy
(
vm
.
$
)
||
vm
;
}
return
component
;
}
function
initRefs
(
instance
,
mpInstance
)
{
Object
.
defineProperty
(
instance
,
'
refs
'
,
{
get
()
{
...
...
@@ -500,7 +507,7 @@ function initRefs(instance, mpInstance) {
if
(
!
$refs
[
ref
])
{
$refs
[
ref
]
=
[];
}
$refs
[
ref
].
push
(
component
.
$vm
||
component
);
$refs
[
ref
].
push
(
findRefValue
(
component
)
);
});
return
$refs
;
},
...
...
packages/uni-mp-toutiao/dist/uni.mp.esm.js
浏览文件 @
e5eb8c38
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
,
isObject
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
import
{
injectHook
,
ref
,
nextTick
,
getExposeProxy
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
...
...
@@ -486,9 +486,16 @@ function selectAllComponents(mpInstance, selector, $refs) {
const
components
=
mpInstance
.
selectAllComponents
(
selector
);
components
.
forEach
((
component
)
=>
{
const
ref
=
component
.
properties
.
uR
;
$refs
[
ref
]
=
component
.
$vm
||
component
;
$refs
[
ref
]
=
findRefValue
(
component
)
;
});
}
function
findRefValue
(
component
)
{
const
vm
=
component
.
$vm
;
if
(
vm
)
{
return
getExposeProxy
(
vm
.
$
)
||
vm
;
}
return
component
;
}
function
initRefs
(
instance
,
mpInstance
)
{
Object
.
defineProperty
(
instance
,
'
refs
'
,
{
get
()
{
...
...
@@ -503,7 +510,7 @@ function initRefs(instance, mpInstance) {
if
(
!
$refs
[
ref
])
{
$refs
[
ref
]
=
[];
}
$refs
[
ref
].
push
(
component
.
$vm
||
component
);
$refs
[
ref
].
push
(
findRefValue
(
component
)
);
});
return
$refs
;
},
...
...
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
e5eb8c38
...
...
@@ -4734,7 +4734,8 @@ function setRef$1(instance, isUnmount = false) {
function
findComponentPublicInstance
(
mpComponents
,
id
)
{
const
mpInstance
=
mpComponents
.
find
(
com
=>
com
&&
(
com
.
properties
||
com
.
props
).
uI
===
id
);
if
(
mpInstance
)
{
return
mpInstance
.
$vm
;
const
vm
=
mpInstance
.
$vm
;
return
getExposeProxy
(
vm
.
$
)
||
vm
;
}
return
null
;
}
...
...
@@ -5505,4 +5506,4 @@ function createApp(rootComponent, rootProps = null) {
}
const
createSSRApp
=
createApp
;
export
{
EffectScope
,
Fragment
,
ReactiveEffect
,
Text
,
c
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed
,
createApp
,
createSSRApp
,
createVNode$1
as
createVNode
,
createVueApp
,
customRef
,
d
,
defineAsyncComponent
,
defineComponent
,
defineEmits
,
defineExpose
,
defineProps
,
diff
,
e
,
effect
,
effectScope
,
f
,
findComponentPropsData
,
getCurrentInstance
,
getCurrentScope
,
guardReactiveProps
,
h
,
inject
,
injectHook
,
invalidateJob
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
mergeDefaults
,
mergeProps
,
n
,
nextTick
,
o
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onScopeDispose
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
p
,
patch
,
provide
,
proxyRefs
,
pruneComponentPropsCache
,
queuePostFlushCb
,
r
,
reactive
,
readonly
,
ref
,
resolveComponent
,
resolveDirective
,
resolveFilter
,
s
,
setCurrentRenderingInstance
,
setTemplateRef
,
setupDevtoolsPlugin
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
sr
,
stop
,
t
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
updateProps
,
useAttrs
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
version
,
w
,
warn$1
as
warn
,
watch
,
watchEffect
,
watchPostEffect
,
watchSyncEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withModifiers
,
withScopeId
};
export
{
EffectScope
,
Fragment
,
ReactiveEffect
,
Text
,
c
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed
,
createApp
,
createSSRApp
,
createVNode$1
as
createVNode
,
createVueApp
,
customRef
,
d
,
defineAsyncComponent
,
defineComponent
,
defineEmits
,
defineExpose
,
defineProps
,
diff
,
e
,
effect
,
effectScope
,
f
,
findComponentPropsData
,
getCurrentInstance
,
getCurrentScope
,
g
etExposeProxy
,
g
uardReactiveProps
,
h
,
inject
,
injectHook
,
invalidateJob
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
mergeDefaults
,
mergeProps
,
n
,
nextTick
,
o
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onScopeDispose
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
p
,
patch
,
provide
,
proxyRefs
,
pruneComponentPropsCache
,
queuePostFlushCb
,
r
,
reactive
,
readonly
,
ref
,
resolveComponent
,
resolveDirective
,
resolveFilter
,
s
,
setCurrentRenderingInstance
,
setTemplateRef
,
setupDevtoolsPlugin
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
sr
,
stop
,
t
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
updateProps
,
useAttrs
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
version
,
w
,
warn$1
as
warn
,
watch
,
watchEffect
,
watchPostEffect
,
watchSyncEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withModifiers
,
withScopeId
};
packages/uni-mp-vue/lib/vue.runtime.esm.js
浏览文件 @
e5eb8c38
...
...
@@ -4734,7 +4734,8 @@ function setRef(instance, isUnmount = false) {
function
findComponentPublicInstance
(
mpComponents
,
id
)
{
const
mpInstance
=
mpComponents
.
find
(
com
=>
com
&&
(
com
.
properties
||
com
.
props
).
uI
===
id
);
if
(
mpInstance
)
{
return
mpInstance
.
$vm
;
const
vm
=
mpInstance
.
$vm
;
return
getExposeProxy
(
vm
.
$
)
||
vm
;
}
return
null
;
}
...
...
@@ -5071,4 +5072,4 @@ function initCssVarsRender(instance, getter) {
function
withModifiers
()
{
}
function
createVNode$1
()
{
}
export
{
EffectScope
,
Fragment
,
ReactiveEffect
,
Text
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed
,
createVNode$1
as
createVNode
,
createVueApp
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmits
,
defineExpose
,
defineProps
,
diff
,
effect
,
effectScope
,
getCurrentInstance
,
getCurrentScope
,
guardReactiveProps
,
inject
,
injectHook
,
invalidateJob
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
mergeDefaults
,
mergeProps
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onScopeDispose
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
patch
,
provide
,
proxyRefs
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
resolveComponent
,
resolveDirective
,
resolveFilter
,
setCurrentRenderingInstance
,
setTemplateRef
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
stop
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
updateProps
,
useAttrs
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
version
,
warn$1
as
warn
,
watch
,
watchEffect
,
watchPostEffect
,
watchSyncEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withModifiers
,
withScopeId
};
export
{
EffectScope
,
Fragment
,
ReactiveEffect
,
Text
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed
,
createVNode$1
as
createVNode
,
createVueApp
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmits
,
defineExpose
,
defineProps
,
diff
,
effect
,
effectScope
,
getCurrentInstance
,
getCurrentScope
,
g
etExposeProxy
,
g
uardReactiveProps
,
inject
,
injectHook
,
invalidateJob
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
mergeDefaults
,
mergeProps
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onScopeDispose
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
patch
,
provide
,
proxyRefs
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
resolveComponent
,
resolveDirective
,
resolveFilter
,
setCurrentRenderingInstance
,
setTemplateRef
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
stop
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
updateProps
,
useAttrs
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
version
,
warn$1
as
warn
,
watch
,
watchEffect
,
watchPostEffect
,
watchSyncEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withModifiers
,
withScopeId
};
packages/uni-mp-weixin/dist/uni.mp.esm.js
浏览文件 @
e5eb8c38
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
import
{
injectHook
,
ref
,
getExposeProxy
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
...
...
@@ -355,9 +355,16 @@ function selectAllComponents(mpInstance, selector, $refs) {
const
components
=
mpInstance
.
selectAllComponents
(
selector
);
components
.
forEach
((
component
)
=>
{
const
ref
=
component
.
properties
.
uR
;
$refs
[
ref
]
=
component
.
$vm
||
component
;
$refs
[
ref
]
=
findRefValue
(
component
)
;
});
}
function
findRefValue
(
component
)
{
const
vm
=
component
.
$vm
;
if
(
vm
)
{
return
getExposeProxy
(
vm
.
$
)
||
vm
;
}
return
component
;
}
function
initRefs
(
instance
,
mpInstance
)
{
Object
.
defineProperty
(
instance
,
'
refs
'
,
{
get
()
{
...
...
@@ -372,7 +379,7 @@ function initRefs(instance, mpInstance) {
if
(
!
$refs
[
ref
])
{
$refs
[
ref
]
=
[];
}
$refs
[
ref
].
push
(
component
.
$vm
||
component
);
$refs
[
ref
].
push
(
findRefValue
(
component
)
);
});
return
$refs
;
},
...
...
packages/uni-quickapp-webview/dist/uni.mp.esm.js
浏览文件 @
e5eb8c38
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
,
isObject
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
import
{
injectHook
,
ref
,
nextTick
,
getExposeProxy
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
...
...
@@ -483,9 +483,16 @@ function selectAllComponents(mpInstance, selector, $refs) {
const
components
=
mpInstance
.
selectAllComponents
(
selector
);
components
.
forEach
((
component
)
=>
{
const
ref
=
component
.
properties
.
uR
;
$refs
[
ref
]
=
component
.
$vm
||
component
;
$refs
[
ref
]
=
findRefValue
(
component
)
;
});
}
function
findRefValue
(
component
)
{
const
vm
=
component
.
$vm
;
if
(
vm
)
{
return
getExposeProxy
(
vm
.
$
)
||
vm
;
}
return
component
;
}
function
initRefs
(
instance
,
mpInstance
)
{
Object
.
defineProperty
(
instance
,
'
refs
'
,
{
get
()
{
...
...
@@ -500,7 +507,7 @@ function initRefs(instance, mpInstance) {
if
(
!
$refs
[
ref
])
{
$refs
[
ref
]
=
[];
}
$refs
[
ref
].
push
(
component
.
$vm
||
component
);
$refs
[
ref
].
push
(
findRefValue
(
component
)
);
});
return
$refs
;
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录