2016-05-15 06:45:54 +08:00
|
|
|
declare type InternalComponentOptions = {
|
2016-07-26 09:28:46 +08:00
|
|
|
_isComponent: true;
|
|
|
|
parent: Component;
|
|
|
|
propsData: ?Object;
|
|
|
|
_parentVnode: VNode;
|
|
|
|
_parentListeners: ?Object;
|
2016-12-05 00:34:53 +08:00
|
|
|
_renderChildren: ?Array<VNode>;
|
2016-07-26 09:28:46 +08:00
|
|
|
_componentTag: ?string;
|
2016-11-26 06:12:40 +08:00
|
|
|
_parentElm: ?Node;
|
|
|
|
_refElm: ?Node;
|
2016-07-26 09:28:46 +08:00
|
|
|
render?: Function;
|
2016-05-15 06:45:54 +08:00
|
|
|
staticRenderFns?: Array<Function>
|
2017-05-15 16:01:30 +08:00
|
|
|
};
|
2016-05-15 06:45:54 +08:00
|
|
|
|
2016-05-14 15:08:21 +08:00
|
|
|
declare type ComponentOptions = {
|
2016-05-14 16:10:48 +08:00
|
|
|
// data
|
2016-07-26 09:28:46 +08:00
|
|
|
data: Object | Function | void;
|
|
|
|
props?: { [key: string]: PropOptions };
|
|
|
|
propsData?: ?Object;
|
2016-05-14 16:10:48 +08:00
|
|
|
computed?: {
|
|
|
|
[key: string]: Function | {
|
2016-07-26 09:28:46 +08:00
|
|
|
get?: Function;
|
|
|
|
set?: Function;
|
2016-05-14 16:10:48 +08:00
|
|
|
cache?: boolean
|
|
|
|
}
|
2016-07-26 09:28:46 +08:00
|
|
|
};
|
2017-02-22 11:35:50 +08:00
|
|
|
methods?: { [key: string]: Function };
|
|
|
|
watch?: { [key: string]: Function | string };
|
|
|
|
|
2016-05-14 16:10:48 +08:00
|
|
|
// DOM
|
2016-07-26 09:28:46 +08:00
|
|
|
el?: string | Element;
|
|
|
|
template?: string;
|
2017-02-20 13:16:40 +08:00
|
|
|
render: (h: () => VNode) => VNode;
|
|
|
|
renderError?: (h: () => VNode, err: Error) => VNode;
|
2016-07-26 09:28:46 +08:00
|
|
|
staticRenderFns?: Array<() => VNode>;
|
2017-02-22 11:35:50 +08:00
|
|
|
|
2016-05-14 16:10:48 +08:00
|
|
|
// lifecycle
|
2016-09-27 10:54:57 +08:00
|
|
|
beforeCreate?: Function;
|
2016-07-26 09:28:46 +08:00
|
|
|
created?: Function;
|
|
|
|
beforeMount?: Function;
|
|
|
|
mounted?: Function;
|
|
|
|
beforeUpdate?: Function;
|
|
|
|
updated?: Function;
|
2017-02-22 11:35:50 +08:00
|
|
|
activated?: Function;
|
|
|
|
deactivated?: Function;
|
|
|
|
beforeDestroy?: Function;
|
|
|
|
destroyed?: Function;
|
|
|
|
|
2016-05-14 16:10:48 +08:00
|
|
|
// assets
|
2016-07-26 09:28:46 +08:00
|
|
|
directives?: { [key: string]: Object };
|
|
|
|
components?: { [key: string]: Class<Component> };
|
|
|
|
transitions?: { [key: string]: Object };
|
|
|
|
filters?: { [key: string]: Function };
|
2017-02-22 11:35:50 +08:00
|
|
|
|
|
|
|
// context
|
2017-02-26 12:19:36 +08:00
|
|
|
provide?: { [key: string | Symbol]: any } | () => { [key: string | Symbol]: any };
|
|
|
|
inject?: { [key: string]: string | Symbol } | Array<string>;
|
2017-02-22 11:35:50 +08:00
|
|
|
|
|
|
|
// component v-model customization
|
|
|
|
model?: {
|
|
|
|
prop?: string;
|
|
|
|
event?: string;
|
|
|
|
};
|
|
|
|
|
2016-05-14 16:10:48 +08:00
|
|
|
// misc
|
2016-07-26 09:28:46 +08:00
|
|
|
parent?: Component;
|
|
|
|
mixins?: Array<Object>;
|
|
|
|
name?: string;
|
|
|
|
extends?: Class<Component> | Object;
|
|
|
|
delimiters?: [string, string];
|
2017-06-30 08:56:23 +08:00
|
|
|
comments?: boolean;
|
2016-05-14 15:08:21 +08:00
|
|
|
|
2016-05-14 16:10:48 +08:00
|
|
|
// private
|
2016-07-26 09:28:46 +08:00
|
|
|
_isComponent?: true;
|
|
|
|
_propKeys?: Array<string>;
|
|
|
|
_parentVnode?: VNode;
|
|
|
|
_parentListeners?: ?Object;
|
2016-12-05 00:34:53 +08:00
|
|
|
_renderChildren?: ?Array<VNode>;
|
2016-10-21 01:34:06 +08:00
|
|
|
_componentTag: ?string;
|
|
|
|
_scopeId: ?string;
|
2016-11-10 10:19:01 +08:00
|
|
|
_base: Class<Component>;
|
2016-11-26 06:12:40 +08:00
|
|
|
_parentElm: ?Node;
|
|
|
|
_refElm: ?Node;
|
2017-05-15 16:01:30 +08:00
|
|
|
};
|
2016-05-14 16:10:48 +08:00
|
|
|
|
|
|
|
declare type PropOptions = {
|
2016-07-26 09:28:46 +08:00
|
|
|
type: Function | Array<Function> | null;
|
|
|
|
default: any;
|
|
|
|
required: ?boolean;
|
|
|
|
validator: ?Function;
|
2016-05-14 15:08:21 +08:00
|
|
|
}
|