Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/vuePublic

Commitdb9c566

Browse files
committed
fix: account for nested render calls
close#13131
1 parent895669f commitdb9c566

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎src/core/instance/render.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import VNode, { createEmptyVNode } from '../vdom/vnode'
1515

1616
import{isUpdatingChildComponent}from'./lifecycle'
1717
importtype{Component}from'types/component'
18-
import{setCurrentInstance}from'v3/currentInstance'
18+
import{currentInstance,setCurrentInstance}from'v3/currentInstance'
1919
import{syncSetupSlots}from'v3/apiSetup'
2020

2121
exportfunctioninitRender(vm:Component){
@@ -120,11 +120,10 @@ export function renderMixin(Vue: typeof Component) {
120120
// to the data on the placeholder node.
121121
vm.$vnode=_parentVnode!
122122
// render self
123+
constprevInst=currentInstance
124+
constprevRenderInst=currentRenderingInstance
123125
letvnode
124126
try{
125-
// There's no need to maintain a stack because all render fns are called
126-
// separately from one another. Nested component's render fns are called
127-
// when parent component is patched.
128127
setCurrentInstance(vm)
129128
currentRenderingInstance=vm
130129
vnode=render.call(vm._renderProxy,vm.$createElement)
@@ -148,8 +147,8 @@ export function renderMixin(Vue: typeof Component) {
148147
vnode=vm._vnode
149148
}
150149
}finally{
151-
currentRenderingInstance=null
152-
setCurrentInstance()
150+
currentRenderingInstance=prevRenderInst
151+
setCurrentInstance(prevInst)
153152
}
154153
// if the returned array contains only a single node, allow it
155154
if(isArray(vnode)&&vnode.length===1){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp