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

Interface for declaring custom options.

Example

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?: never;
    __isSuspense?: never;
    __isTeleport?: never;
    __name?: string;
    beforeRouteEnter?: NavigationGuardWithThis<undefined>;
    beforeRouteLeave?: NavigationGuard;
    beforeRouteUpdate?: NavigationGuard;
    call?: ((this, ...args) => never);
    compatConfig?: CompatConfig;
    compilerOptions?: RuntimeCompilerOptions;
    components?: Record<string, Component<any, any, any, ComputedOptions, MethodOptions, {}, any>>;
    computed?: C;
    data?: ((this, vm) => D);
    delimiters?: [string, string];
    directives?: Record<string, 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, props, ctx) => 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?: never
__isSuspense?: never
__isTeleport?: never
__name?: string

name inferred from filename

beforeRouteEnter?: NavigationGuardWithThis<undefined>

Guard called when the router is navigating to the route that is rendering this component from a different route. Differently from beforeRouteUpdate and beforeRouteLeave, beforeRouteEnter does not have access to the component instance through this because it triggers before the component is even mounted.

Param: to

RouteLocationRaw we are navigating to

Param: from

RouteLocationRaw we are navigating from

Param: next

function to validate, cancel or modify (by redirecting) the navigation

beforeRouteLeave?: NavigationGuard

Guard called when the router is navigating away from the current route that is rendering this component.

Param: to

RouteLocationRaw we are navigating to

Param: from

RouteLocationRaw we are navigating from

Param: next

function to validate, cancel or modify (by redirecting) the navigation

beforeRouteUpdate?: NavigationGuard

Guard called whenever the route that renders this component has changed, but it is reused for the new route. This allows you to guard for changes in params, the query or the hash.

Param: to

RouteLocationRaw we are navigating to

Param: from

RouteLocationRaw we are navigating from

Param: next

function to validate, cancel or modify (by redirecting) the navigation

call?: ((this, ...args) => never)

Type declaration

    • (this, ...args): never
    • Parameters

      • this: unknown
      • Rest ...args: unknown[]

      Returns never

compatConfig?: CompatConfig
compilerOptions?: RuntimeCompilerOptions
components?: Record<string, Component<any, any, any, ComputedOptions, MethodOptions, {}, any>>
computed?: C
data?: ((this, vm) => D)

Type declaration

delimiters?: [string, string]

runtime compile only

Deprecated

use compilerOptions.delimiters instead.

directives?: Record<string, 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, props, ctx) => void | RawBindings | RenderFunction | Promise<RawBindings>)

Type declaration

slots?: S
template?: string | object
watch?: ComponentWatchOptions

Methods

  • Returns void

  • Returns void

  • Returns void

    Deprecated

    use beforeUnmount instead

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

    Deprecated

    use unmounted instead

  • Returns void

  • Returns void | Promise<any>

  • Returns void

  • Returns void

Generated using TypeDoc