mirror of https://github.com/vuejs/core.git
fix: throw error without `script` block (#61)
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
This commit is contained in:
parent
5e681b5945
commit
9e031275d7
|
@ -20,7 +20,7 @@ export type FunctionalComponent = SetupFn & {
|
|||
}
|
||||
export interface ObjectComponent {
|
||||
props: ComponentPropsOptions
|
||||
setup: SetupFn
|
||||
setup?: SetupFn
|
||||
render(ctx: any): Block
|
||||
}
|
||||
|
||||
|
|
|
@ -50,11 +50,10 @@ export function mountComponent(
|
|||
|
||||
const setupFn =
|
||||
typeof component === 'function' ? component : component.setup
|
||||
|
||||
const state = setupFn(props, ctx)
|
||||
instance.proxy = markRaw(
|
||||
new Proxy({ _: instance }, PublicInstanceProxyHandlers),
|
||||
)
|
||||
const state = setupFn && setupFn(props, ctx)
|
||||
if (state && '__isScriptSetup' in state) {
|
||||
instance.setupState = proxyRefs(state)
|
||||
return (instance.block = component.render(instance.proxy))
|
||||
|
|
Loading…
Reference in New Issue