-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
/
Copy pathoptions.ts
114 lines (99 loc) · 2.54 KB
/
options.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import VNode from 'core/vdom/vnode'
import { DebuggerEvent } from 'v3/debug'
import { SetupContext } from 'v3/apiSetup'
import { Component } from './component'
export type InternalComponentOptions = {
_isComponent: true
parent: Component
_parentVnode: VNode
render?: Function
staticRenderFns?: Array<Function>
}
type InjectKey = string | Symbol
/**
* @internal
*/
export type ComponentOptions = {
// v3
setup?: (props: Record<string, any>, ctx: SetupContext) => unknown
[key: string]: any
componentId?: string
// data
data: object | Function | void
props?:
| string[]
| Record<string, Function | Array<Function> | null | PropOptions>
propsData?: object
computed?: {
[key: string]:
| Function
| {
get?: Function
set?: Function
cache?: boolean
}
}
methods?: { [key: string]: Function }
watch?: { [key: string]: Function | string }
// DOM
el?: string | Element
template?: string
render: (h: () => VNode) => VNode
renderError?: (h: () => VNode, err: Error) => VNode
staticRenderFns?: Array<() => VNode>
// lifecycle
beforeCreate?: Function
created?: Function
beforeMount?: Function
mounted?: Function
beforeUpdate?: Function
updated?: Function
activated?: Function
deactivated?: Function
beforeDestroy?: Function
destroyed?: Function
errorCaptured?: () => boolean | void
serverPrefetch?: Function
renderTracked?(e: DebuggerEvent): void
renderTriggerd?(e: DebuggerEvent): void
// assets
directives?: { [key: string]: object }
components?: { [key: string]: Component }
transitions?: { [key: string]: object }
filters?: { [key: string]: Function }
// context
provide?: Record<string | symbol, any> | (() => Record<string | symbol, any>)
inject?:
| { [key: string]: InjectKey | { from?: InjectKey; default?: any } }
| Array<string>
// component v-model customization
model?: {
prop?: string
event?: string
}
// misc
parent?: Component
mixins?: Array<object>
name?: string
extends?: Component | object
delimiters?: [string, string]
comments?: boolean
inheritAttrs?: boolean
// Legacy API
abstract?: any
// private
_isComponent?: true
_propKeys?: Array<string>
_parentVnode?: VNode
_parentListeners?: object | null
_renderChildren?: Array<VNode> | null
_componentTag: string | null
_scopeId: string | null
_base: typeof Component
}
export type PropOptions = {
type?: Function | Array<Function> | null
default?: any
required?: boolean | null
validator?: Function | null
}