-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.js
75 lines (72 loc) · 1.67 KB
/
options.js
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
declare type InternalComponentOptions = {
_isComponent: true;
parent: Component;
propsData: ?Object;
_parentVnode: VNode;
_parentListeners: ?Object;
_renderChildren: ?Array<VNode>;
_componentTag: ?string;
_parentElm: ?Node;
_refElm: ?Node;
render?: Function;
staticRenderFns?: Array<Function>
}
declare type ComponentOptions = {
// data
data: Object | Function | void;
props?: { [key: string]: 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: () => VNode;
staticRenderFns?: Array<() => VNode>;
// lifecycle
beforeCreate?: Function;
created?: Function;
beforeMount?: Function;
mounted?: Function;
beforeUpdate?: Function;
updated?: Function;
// assets
directives?: { [key: string]: Object };
components?: { [key: string]: Class<Component> };
transitions?: { [key: string]: Object };
filters?: { [key: string]: Function };
// misc
parent?: Component;
mixins?: Array<Object>;
name?: string;
extends?: Class<Component> | Object;
delimiters?: [string, string];
// private
_isComponent?: true;
_propKeys?: Array<string>;
_parentVnode?: VNode;
_parentListeners?: ?Object;
_renderChildren?: ?Array<VNode>;
_componentTag: ?string;
_scopeId: ?string;
_base: Class<Component>;
_parentElm: ?Node;
_refElm: ?Node;
}
declare type PropOptions = {
type: Function | Array<Function> | null;
default: any;
required: ?boolean;
validator: ?Function;
}