Skip to content

Commit

Permalink
fix(runtime-vapor): set setupState
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Jan 20, 2024
1 parent 35334fd commit 9d071e7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/runtime-vapor/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9d071e7

Please sign in to comment.