Interface ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S>

Interface for declaring custom options.

declare module '@vue/runtime-core' {
interface ComponentCustomOptions {
beforeRouteUpdate?(
to: Route,
from: Route,
next: () => void
): void
}
}
interface ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S> {
    __defaults?: Defaults;
    __differentiator?: keyof D | keyof C | keyof M;
    __file?: string;
    __isBuiltIn?: boolean;
    __isFragment?: undefined;
    __isSuspense?: undefined;
    __isTeleport?: undefined;
    __name?: string;
    call?: ((this: unknown, ...args: unknown[]) => never);
    compatConfig?: CompatConfig;
    compilerOptions?: RuntimeCompilerOptions;
    components?: Record<string, Component<any, any, any, ComputedOptions, MethodOptions, {}, any>>;
    computed?: C;
    data?: ((this: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends, {}, Props, {}, false, {}, {}, IntersectionMixin<Mixin> & IntersectionMixin<Extends>, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "P"> & EnsureNonVoid<Props>, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "B"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "D"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "C"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "M"> & MethodOptions, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "Defaults"> & {}>, vm: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends, {}, Props, {}, false, {}, {}, IntersectionMixin<Mixin> & IntersectionMixin<Extends>, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "P"> & EnsureNonVoid<Props>, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "B"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "D"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "C"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "M"> & MethodOptions, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "Defaults"> & {}>) => D);
    delimiters?: [string, string];
    directives?: Record<string, vue.Directive<any, any>>;
    emits?: (E | EE[]) & ThisType<void>;
    errorCaptured?: ErrorCapturedHook<unknown>;
    expose?: string[];
    extends?: Extends;
    filters?: Record<string, Function>;
    inheritAttrs?: boolean;
    inject?: I | II[];
    methods?: M;
    mixins?: Mixin[];
    name?: string;
    provide?: ComponentProvideOptions;
    render?: Function;
    renderTracked?: DebuggerHook;
    renderTriggered?: DebuggerHook;
    setup?: ((this: void, props: LooseRequired<Props & {
        [K in string | number | symbol]: UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "P">[K]
    }>, ctx: SetupContext<E, S>) =>
        | void
        | RawBindings
        | RenderFunction
        | Promise<RawBindings>);
    slots?: S;
    template?: string | object;
    watch?: ComponentWatchOptions;
    activated?(): void;
    beforeCreate?(): void;
    beforeDestroy?(): void;
    beforeMount?(): void;
    beforeUnmount?(): void;
    beforeUpdate?(): void;
    created?(): void;
    deactivated?(): void;
    destroyed?(): void;
    mounted?(): void;
    serverPrefetch?(): void | Promise<any>;
    unmounted?(): void;
    updated?(): void;
}

Type Parameters

Hierarchy (view full)

Properties

__defaults?: Defaults
__differentiator?: keyof D | keyof C | keyof M

#3468

type-only, used to assist Mixin's type inference, typescript will try to simplify the inferred Mixin type, with the __differentiator, typescript won't be able to combine different mixins, because the __differentiator will be different

__file?: string

This one should be exposed so that devtools can make use of it

__isBuiltIn?: boolean

Compat build only, for bailing out of certain compatibility behavior

__isFragment?: undefined
__isSuspense?: undefined
__isTeleport?: undefined
__name?: string

name inferred from filename

call?: ((this: unknown, ...args: unknown[]) => never)
compatConfig?: CompatConfig
compilerOptions?: RuntimeCompilerOptions
components?: Record<string, Component<any, any, any, ComputedOptions, MethodOptions, {}, any>>
computed?: C
data?: ((this: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends, {}, Props, {}, false, {}, {}, IntersectionMixin<Mixin> & IntersectionMixin<Extends>, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "P"> & EnsureNonVoid<Props>, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "B"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "D"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "C"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "M"> & MethodOptions, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "Defaults"> & {}>, vm: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends, {}, Props, {}, false, {}, {}, IntersectionMixin<Mixin> & IntersectionMixin<Extends>, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "P"> & EnsureNonVoid<Props>, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "B"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "D"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "C"> & {}, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "M"> & MethodOptions, UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "Defaults"> & {}>) => D)
delimiters?: [string, string]

runtime compile only

use compilerOptions.delimiters instead.

directives?: Record<string, vue.Directive<any, any>>
emits?: (E | EE[]) & ThisType<void>
errorCaptured?: ErrorCapturedHook<unknown>
expose?: string[]
extends?: Extends
filters?: Record<string, Function>
inheritAttrs?: boolean
inject?: I | II[]
methods?: M
mixins?: Mixin[]
name?: string
render?: Function
renderTracked?: DebuggerHook
renderTriggered?: DebuggerHook
setup?: ((this: void, props: LooseRequired<Props & {
    [K in string | number | symbol]: UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "P">[K]
}>, ctx: SetupContext<E, S>) =>
    | void
    | RawBindings
    | RenderFunction
    | Promise<RawBindings>)
slots?: S
template?: string | object
watch?: ComponentWatchOptions

Methods

  • Returns void

  • Returns void

  • Returns void

    use beforeUnmount instead

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

    use unmounted instead

  • Returns void

  • Returns void | Promise<any>

  • Returns void

  • Returns void