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__ */
|
||||
export function defineComponent(comp: any) {
|
||||
export function defineComponent(comp: Component): Component {
|
||||
return comp
|
||||
}
|
||||
|
|
|
@ -21,17 +21,15 @@ import { VaporLifecycleHooks } from './enums'
|
|||
|
||||
export type Component = FunctionalComponent | ObjectComponent
|
||||
|
||||
export type SetupFn = (props: any, ctx: any) => Block | Data
|
||||
export type FunctionalComponent = SetupFn & {
|
||||
props: ComponentPropsOptions
|
||||
emits: EmitsOptions
|
||||
render(ctx: any): Block
|
||||
}
|
||||
export type SetupFn = (props: any, ctx: any) => Block | Data | void
|
||||
export type FunctionalComponent = SetupFn & Omit<ObjectComponent, 'setup'>
|
||||
|
||||
export interface ObjectComponent {
|
||||
props: ComponentPropsOptions
|
||||
emits: EmitsOptions
|
||||
props?: ComponentPropsOptions
|
||||
emits?: EmitsOptions
|
||||
setup?: SetupFn
|
||||
render(ctx: any): Block
|
||||
render?(ctx: any): Block
|
||||
vapor?: boolean
|
||||
}
|
||||
|
||||
type LifecycleHook<TFn = Function> = TFn[] | null
|
||||
|
|
Loading…
Reference in New Issue