types: improve emit type (#345)
This commit is contained in:
parent
67eb29f63b
commit
f85ba092ce
@ -60,7 +60,7 @@ export const enum LifecycleHooks {
|
||||
ERROR_CAPTURED = 'ec'
|
||||
}
|
||||
|
||||
type Emit = ((event: string, ...args: unknown[]) => void)
|
||||
export type Emit = ((event: string, ...args: unknown[]) => void)
|
||||
|
||||
export interface SetupContext {
|
||||
attrs: Data
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ComponentInternalInstance, Data } from './component'
|
||||
import { ComponentInternalInstance, Data, Emit } from './component'
|
||||
import { nextTick } from './scheduler'
|
||||
import { instanceWatch } from './apiWatch'
|
||||
import { EMPTY_OBJ, hasOwn, isGloballyWhitelisted } from '@vue/shared'
|
||||
@ -24,7 +24,7 @@ export type ComponentPublicInstance<
|
||||
$slots: Data
|
||||
$root: ComponentInternalInstance | null
|
||||
$parent: ComponentInternalInstance | null
|
||||
$emit: (event: string, ...args: unknown[]) => void
|
||||
$emit: Emit
|
||||
$el: any
|
||||
$options: any
|
||||
$forceUpdate: ReactiveEffect
|
||||
|
Loading…
Reference in New Issue
Block a user