fix(runtime-vapor): set setupState

This commit is contained in:
三咲智子 Kevin Deng 2024-01-20 20:22:06 +08:00
parent 35334fd33e
commit 9d071e7c31
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
1 changed files with 2 additions and 3 deletions

View File

@ -49,15 +49,14 @@ export function mountComponent(
const stateOrNode = setupFn && setupFn(props, ctx)
let block: Block | undefined
let setupState: Data | undefined
if (stateOrNode instanceof Node) {
block = stateOrNode
} else if (isObject(stateOrNode) && !isArray(stateOrNode)) {
setupState = proxyRefs(stateOrNode)
instance.setupState = proxyRefs(stateOrNode)
}
if (!block && component.render) {
block = component.render(setupState)
block = component.render(instance.setupState)
}
if (block instanceof DocumentFragment) {