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 {
    __file: any;
    __isBuiltIn: any;
    __name: any;
    __defaults?: Defaults;
    __differentiator?: keyof D | keyof C | keyof M;
    __isFragment?: undefined;
    __isSuspense?: undefined;
    __isTeleport?: undefined;
    beforeRouteEnter?: NavigationGuardWithThis<undefined>;
    beforeRouteLeave?: NavigationGuard;
    beforeRouteUpdate?: NavigationGuard;
    call?: ((this, ...args) => never);
    compatConfig?: CompatConfig;
    compilerOptions?: RuntimeCompilerOptions;
    components?: Record<string, Component<any, any, any, ComputedOptions, MethodOptions>>;
    computed?: C;
    data?: ((this, vm) => D);
    delimiters?: [string, string];
    directives?: Record<string, vue.Directive<any, any>>;
    emits?: {
        length: null | number | ((...args) => any);
        at(index): any;
        concat(...items): any;
        concat(...items): any;
        copyWithin(target, start, end?): any;
        entries(...args): any;
        entries(): any;
        every(predicate, thisArg?): any;
        fill(value, start?, end?): any;
        filter(predicate, thisArg?): any;
        find(predicate, thisArg?): any;
        findIndex(predicate, thisArg?): any;
        flat<A, D>(this, ...arg0): any;
        flatMap<U, This>(...arg0, ...thisArg, ...args): any;
        forEach(callbackfn, thisArg?): any;
        includes(searchElement, fromIndex?): any;
        indexOf(searchElement, fromIndex?): any;
        join(separator?): any;
        keys(...args): any;
        keys(): any;
        lastIndexOf(searchElement, fromIndex?): any;
        map<U>(...arg0, ...thisArg, ...args): any;
        pop(...args): any;
        pop(): any;
        push(...items): any;
        reduce: any;
        reduceRight: any;
        reverse(...args): any;
        reverse(): any;
        shift(...args): any;
        shift(): any;
        slice(start?, end?): any;
        some(predicate, thisArg?): any;
        sort(compareFn?): any;
        splice(start, deleteCount?): any;
        splice(start, deleteCount, ...items): any;
        splice(start, deleteCount, ...items): any;
        toLocaleString(): string;
        toString(): string;
        unshift(...items): any;
        values(...args): any;
        values(): any;
    };
    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

  • LegacyOptions<Props, D, C, M, Mixin, Extends, I, II>
  • ComponentInternalOptions
  • ComponentCustomOptions
    • ComponentOptionsBase

References

Re-exports __file
Re-exports __isBuiltIn
Re-exports __name

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

__isFragment?: undefined
__isSuspense?: undefined
__isTeleport?: undefined
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>>
computed?: C
data?: ((this, vm) => D)

Type declaration

    • (this, vm): D
    • Parameters

      • 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"> & {}>

      Returns D

delimiters?: [string, string]

runtime compile only

Deprecated

use compilerOptions.delimiters instead.

directives?: Record<string, vue.Directive<any, any>>
emits?: {
    length: null | number | ((...args) => any);
    at(index): any;
    concat(...items): any;
    concat(...items): any;
    copyWithin(target, start, end?): any;
    entries(...args): any;
    entries(): any;
    every(predicate, thisArg?): any;
    fill(value, start?, end?): any;
    filter(predicate, thisArg?): any;
    find(predicate, thisArg?): any;
    findIndex(predicate, thisArg?): any;
    flat<A, D>(this, ...arg0): any;
    flatMap<U, This>(...arg0, ...thisArg, ...args): any;
    forEach(callbackfn, thisArg?): any;
    includes(searchElement, fromIndex?): any;
    indexOf(searchElement, fromIndex?): any;
    join(separator?): any;
    keys(...args): any;
    keys(): any;
    lastIndexOf(searchElement, fromIndex?): any;
    map<U>(...arg0, ...thisArg, ...args): any;
    pop(...args): any;
    pop(): any;
    push(...items): any;
    reduce: any;
    reduceRight: any;
    reverse(...args): any;
    reverse(): any;
    shift(...args): any;
    shift(): any;
    slice(start?, end?): any;
    some(predicate, thisArg?): any;
    sort(compareFn?): any;
    splice(start, deleteCount?): any;
    splice(start, deleteCount, ...items): any;
    splice(start, deleteCount, ...items): any;
    toLocaleString(): string;
    toString(): string;
    unshift(...items): any;
    values(...args): any;
    values(): any;
}

Type declaration

  • length: null | number | ((...args) => any)

    Gets or sets the length of the array. This is a number one higher than the highest index in the array.

  • at:function
    • Returns the item located at the specified index.

      Parameters

      • index: number

        The zero-based index of the desired code unit. A negative index will count back from the last item.

      Returns any

  • concat:function
    • Combines two or more arrays. This method returns a new array without modifying any existing arrays.

      Parameters

      • Rest ...items: ConcatArray<EE>[]

        Additional arrays and/or items to add to the end of the array.

      Returns any

    • Combines two or more arrays. This method returns a new array without modifying any existing arrays.

      Parameters

      • Rest ...items: (EE | ConcatArray<EE>)[]

        Additional arrays and/or items to add to the end of the array.

      Returns any

  • copyWithin:function
    • Returns the this object after copying a section of the array identified by start and end to the same array starting at position target

      Parameters

      • target: number

        If target is negative, it is treated as length+target where length is the length of the array.

      • start: number

        If start is negative, it is treated as length+start. If end is negative, it is treated as length+end.

      • Optional end: number

        If not specified, length of the this object is used as its default value.

      Returns any

  • entries:function
    • Parameters

      • Rest ...args: any[]

      Returns any

    • Returns an iterable of key, value pairs for every entry in the array

      Returns any

  • every:function
    • Determines whether all the members of an array satisfy the specified test.

      Parameters

      • predicate: ((value, index, array) => unknown)

        A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.

          • (value, index, array): unknown
          • Parameters

            • value: string
            • index: number
            • array: string[]

            Returns unknown

      • Optional thisArg: any

        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      Returns any

  • fill:function
    • Changes all array elements from start to end index to a static value and returns the modified array

      Parameters

      • value: EE

        value to fill array section with

      • Optional start: number

        index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.

      • Optional end: number

        index to stop filling the array at. If end is negative, it is treated as length+end.

      Returns any

  • filter:function
    • Returns the elements of an array that meet the condition specified in a callback function.

      Parameters

      • predicate: ((value, index, array) => unknown)

        A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.

          • (value, index, array): unknown
          • Parameters

            • value: string
            • index: number
            • array: string[]

            Returns unknown

      • Optional thisArg: any

        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      Returns any

  • find:function
    • Parameters

      • predicate: ((value, index, obj) => unknown)
          • (value, index, obj): unknown
          • Parameters

            • value: string
            • index: number
            • obj: string[]

            Returns unknown

      • Optional thisArg: any

      Returns any

  • findIndex:function
    • Returns the index of the first element in the array where predicate is true, and -1 otherwise.

      Parameters

      • predicate: ((value, index, obj) => unknown)

        find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.

          • (value, index, obj): unknown
          • Parameters

            • value: string
            • index: number
            • obj: string[]

            Returns unknown

      • Optional thisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns any

  • flat:function
    • Type Parameters

      • A

      • D extends number = 1

      Parameters

      • this: A
      • Rest ...arg0: any[]

      Returns any

  • flatMap:function
    • Type Parameters

      • U

      • This = undefined

      Parameters

      • Rest ...arg0: any
      • Rest ...thisArg: any
      • Rest ...args: any[]

      Returns any

  • forEach:function
    • Performs the specified action for each element in an array.

      Parameters

      • callbackfn: ((value, index, array) => void)

        A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

          • (value, index, array): void
          • Parameters

            • value: string
            • index: number
            • array: string[]

            Returns void

      • Optional thisArg: any

        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

      Returns any

  • includes:function
    • Determines whether an array includes a certain element, returning true or false as appropriate.

      Parameters

      • searchElement: EE

        The element to search for.

      • Optional fromIndex: number

        The position in this array at which to begin searching for searchElement.

      Returns any

  • indexOf:function
    • Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

      Parameters

      • searchElement: EE

        The value to locate in the array.

      • Optional fromIndex: number

        The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

      Returns any

  • join:function
    • Adds all the elements of an array into a string, separated by the specified separator string.

      Parameters

      • Optional separator: string

        A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.

      Returns any

  • keys:function
    • Parameters

      • Rest ...args: any[]

      Returns any

    • Returns an iterable of keys in the array

      Returns any

  • lastIndexOf:function
    • Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.

      Parameters

      • searchElement: EE

        The value to locate in the array.

      • Optional fromIndex: number

        The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.

      Returns any

  • map:function
    • Type Parameters

      • U

      Parameters

      • Rest ...arg0: any
      • Rest ...thisArg: any
      • Rest ...args: any[]

      Returns any

  • pop:function
    • Parameters

      • Rest ...args: any[]

      Returns any

    • Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.

      Returns any

  • push:function
    • Appends new elements to the end of an array, and returns the new length of the array.

      Parameters

      • Rest ...items: EE[]

        New elements to add to the array.

      Returns any

  • reverse:function
    • Parameters

      • Rest ...args: any[]

      Returns any

    • Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array.

      Returns any

  • shift:function
    • Parameters

      • Rest ...args: any[]

      Returns any

    • Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.

      Returns any

  • slice:function
    • Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array.

      Parameters

      • Optional start: number

        The beginning index of the specified portion of the array. If start is undefined, then the slice begins at index 0.

      • Optional end: number

        The end index of the specified portion of the array. This is exclusive of the element at the index 'end'. If end is undefined, then the slice extends to the end of the array.

      Returns any

  • some:function
    • Determines whether the specified callback function returns true for any element of an array.

      Parameters

      • predicate: ((value, index, array) => unknown)

        A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array.

          • (value, index, array): unknown
          • Parameters

            • value: string
            • index: number
            • array: string[]

            Returns unknown

      • Optional thisArg: any

        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      Returns any

  • sort:function
    • Sorts an array in place. This method mutates the array and returns a reference to the same array.

      Parameters

      • Optional compareFn: ((a, b) => number)

        Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.

        [11,2,22,1].sort((a, b) => a - b)
        
          • (a, b): number
          • Parameters

            • a: string
            • b: string

            Returns number

      Returns any

  • splice:function
    • Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

      Parameters

      • start: number

        The zero-based location in the array from which to start removing elements.

      • Optional deleteCount: number

        The number of elements to remove.

      Returns any

      An array containing the elements that were deleted.

    • Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

      Parameters

      • start: number

        The zero-based location in the array from which to start removing elements.

      • deleteCount: number

        The number of elements to remove.

      • Rest ...items: string[]

        Elements to insert into the array in place of the deleted elements.

      Returns any

      An array containing the elements that were deleted.

    • Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

      Parameters

      • start: number

        The zero-based location in the array from which to start removing elements.

      • deleteCount: number

        The number of elements to remove.

      • Rest ...items: EE[]

        Elements to insert into the array in place of the deleted elements.

      Returns any

      An array containing the elements that were deleted.

  • toLocaleString:function
    • Returns a date converted to a string using the current locale.

      Returns string

  • toString:function
    • Returns a string representation of an object.

      Returns string

  • unshift:function
    • Inserts new elements at the start of an array, and returns the new length of the array.

      Parameters

      • Rest ...items: EE[]

        Elements to insert at the start of the array.

      Returns any

  • values:function
    • Parameters

      • Rest ...args: any[]

      Returns any

    • Returns an iterable of values in the array

      Returns any

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

    • (this, props, ctx): void | RawBindings | RenderFunction | Promise<RawBindings>
    • Parameters

      • this: void
      • props: LooseRequired<Props & {
            [K in string | number | symbol]: UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "P">[K]
        }>
      • ctx: SetupContext<E, S>

      Returns void | RawBindings | RenderFunction | Promise<RawBindings>

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