mirror of https://github.com/vuejs/core.git
fix(templateRef): delay setting the ref value if wrapped in Suspense
This commit is contained in:
parent
29de6f8b0b
commit
58cf2365e4
|
@ -28,6 +28,13 @@ export function setRef(
|
||||||
vnode: VNode,
|
vnode: VNode,
|
||||||
isUnmount = false,
|
isUnmount = false,
|
||||||
): void {
|
): void {
|
||||||
|
if (parentSuspense) {
|
||||||
|
queuePostRenderEffect(() => {
|
||||||
|
setRef(rawRef, oldRawRef, null, vnode, isUnmount)
|
||||||
|
}, parentSuspense)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (isArray(rawRef)) {
|
if (isArray(rawRef)) {
|
||||||
rawRef.forEach((r, i) =>
|
rawRef.forEach((r, i) =>
|
||||||
setRef(
|
setRef(
|
||||||
|
|
Loading…
Reference in New Issue