the default Vue export has been removed in Vue 3. The type for
the default export is provided only for migration purposes. Please use
named imports instead - e.g. import { createApp } from 'vue'.
Concrete component type matches its actual value: it's either an options
object, or a function. Use this where the code expects to work with actual
values, e.g. checking if its a function or not. This is mostly for internal
implementation code.
ExtractDefaultPropTypes<O>:O extends object ? {[ K in DefaultKeys<O>]: InferPropType<O[K]>} : {}
Type parameters
O
ExtractPropTypes
ExtractPropTypes<O>:O extends object ? {[ K in keyof O]?: unknown} & {[ K in RequiredKeys<O>]: InferPropType<O[K]>} & {[ K in OptionalKeys<O>]?: InferPropType<O[K]>} : {[ K in string]: any}
Create a block root vnode. Takes the same exact arguments as createVNode.
A block root keeps track of dynamic nodes within the block in the
dynamicChildren array.
The createRenderer function accepts two generic arguments:
HostNode and HostElement, corresponding to Node and Element types in the
host environment. For example, for runtime-dom, HostNode would be the DOM
Node interface and HostElement would be the DOM Element interface.
Custom renderers can pass in the platform specific types like this:
defineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Props & EmitsToProps<E>>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>
defineComponent<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, Readonly<{[ key in string]?: any}> & EmitsToProps<E>>): DefineComponent<Readonly<{[ key in PropNames]?: any}>, RawBindings, D, C, M, Mixin, Extends, E, EE>
defineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, Readonly<ExtractPropTypes<PropsOptions>> & EmitsToProps<E>, ExtractDefaultPropTypes<PropsOptions>>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>
Vue <script setup> compiler macro for declaring a component's exposed
instance properties when it is accessed by a parent component via template
refs.
<script setup> components are closed by default - i.e. varaibles inside
the <script setup> scope is not exposed to parent unless explicitly exposed
via defineExpose.
This is only usable inside <script setup>, is compiled away in the
output and should not be actually called at runtime.
Parameters
Optional exposed: Record<string, any>
Returns void
defineProps
defineProps<PropNames>(props: PropNames[]): Readonly<{[ key in PropNames]?: any}>
Open a block.
This must be called before createBlock. It cannot be part of createBlock
because the children of the block are evaluated before createBlock itself
is called. The generated code typically looks like this:
The reactive conversion is "deep"—it affects all nested properties. In the
ES2015 Proxy based implementation, the returned proxy is not equal to the
original object. It is recommended to work exclusively with the reactive
proxy and avoid relying on the original object.
A reactive object also automatically unwraps refs contained in it, so you
don't need to use .value when accessing and mutating their value:
Block tracking sometimes needs to be disabled, for example during the
creation of a tree that needs to be cached by v-once. The compiler generates
code like this:
Return a shallowly-reactive copy of the original object, where only the root
level properties are reactive. It also does not auto-unwrap refs (even at the
root level).
shallowReadonly<T>(target: T): Readonly<{[ K in keyof T]: UnwrapNestedRefs<T[K]>}>
Returns a reactive-copy of the original object, where only the root level
properties are readonly, and does NOT unwrap refs nor recursively convert
returned properties.
This is used for creating the props proxy object for stateful components.
Type parameters
T: object
Parameters
target: T
Returns Readonly<{[ K in keyof T]: UnwrapNestedRefs<T[K]>}>
shallowRef
shallowRef<T>(value: T): T extends Ref ? T : ShallowRef<T>
Internal API for registering an arguments transform for createVNode
used for creating stubs in the test-utils
It is internal but needs to be exposed for test-utils to pick up proper
typings
the default
Vue
export has been removed in Vue 3. The type for the default export is provided only for migration purposes. Please use named imports instead - e.g.import { createApp } from 'vue'
.