mirror of https://github.com/vuejs/core.git
refactor(runtime-vapor): fix component type
This commit is contained in:
parent
8bb0e0887b
commit
e10f7d1689
|
@ -1,5 +1,6 @@
|
||||||
// TODO
|
import type { Component } from './component'
|
||||||
|
|
||||||
/*! #__NO_SIDE_EFFECTS__ */
|
/*! #__NO_SIDE_EFFECTS__ */
|
||||||
export function defineComponent(comp: any) {
|
export function defineComponent(comp: Component): Component {
|
||||||
return comp
|
return comp
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,17 +21,15 @@ import { VaporLifecycleHooks } from './enums'
|
||||||
|
|
||||||
export type Component = FunctionalComponent | ObjectComponent
|
export type Component = FunctionalComponent | ObjectComponent
|
||||||
|
|
||||||
export type SetupFn = (props: any, ctx: any) => Block | Data
|
export type SetupFn = (props: any, ctx: any) => Block | Data | void
|
||||||
export type FunctionalComponent = SetupFn & {
|
export type FunctionalComponent = SetupFn & Omit<ObjectComponent, 'setup'>
|
||||||
props: ComponentPropsOptions
|
|
||||||
emits: EmitsOptions
|
|
||||||
render(ctx: any): Block
|
|
||||||
}
|
|
||||||
export interface ObjectComponent {
|
export interface ObjectComponent {
|
||||||
props: ComponentPropsOptions
|
props?: ComponentPropsOptions
|
||||||
emits: EmitsOptions
|
emits?: EmitsOptions
|
||||||
setup?: SetupFn
|
setup?: SetupFn
|
||||||
render(ctx: any): Block
|
render?(ctx: any): Block
|
||||||
|
vapor?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
type LifecycleHook<TFn = Function> = TFn[] | null
|
type LifecycleHook<TFn = Function> = TFn[] | null
|
||||||
|
|
Loading…
Reference in New Issue