options.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. declare type InternalComponentOptions = {
  2. _isComponent: true;
  3. parent: Component;
  4. propsData: ?Object;
  5. _parentVnode: VNode;
  6. _parentListeners: ?Object;
  7. _renderChildren: ?VNodeChildren;
  8. _componentTag: ?string;
  9. _parentElm: ?Node;
  10. _refElm: ?Node;
  11. render?: Function;
  12. staticRenderFns?: Array<Function>
  13. }
  14. declare type ComponentOptions = {
  15. // data
  16. data: Object | Function | void;
  17. props?: { [key: string]: PropOptions };
  18. propsData?: ?Object;
  19. computed?: {
  20. [key: string]: Function | {
  21. get?: Function;
  22. set?: Function;
  23. cache?: boolean
  24. }
  25. };
  26. methods?: {
  27. [key: string]: Function
  28. };
  29. watch?: {
  30. [key: string]: Function | string
  31. };
  32. // DOM
  33. el?: string | Element;
  34. template?: string;
  35. render: () => VNode;
  36. staticRenderFns?: Array<() => VNode>;
  37. // lifecycle
  38. beforeCreate?: Function;
  39. created?: Function;
  40. beforeMount?: Function;
  41. mounted?: Function;
  42. beforeUpdate?: Function;
  43. updated?: Function;
  44. // assets
  45. directives?: { [key: string]: Object };
  46. components?: { [key: string]: Class<Component> };
  47. transitions?: { [key: string]: Object };
  48. filters?: { [key: string]: Function };
  49. // misc
  50. parent?: Component;
  51. mixins?: Array<Object>;
  52. name?: string;
  53. extends?: Class<Component> | Object;
  54. delimiters?: [string, string];
  55. // private
  56. _isComponent?: true;
  57. _propKeys?: Array<string>;
  58. _parentVnode?: VNode;
  59. _parentListeners?: ?Object;
  60. _renderChildren?: ?VNodeChildren;
  61. _componentTag: ?string;
  62. _scopeId: ?string;
  63. _base: Class<Component>;
  64. _parentElm: ?Node;
  65. _refElm: ?Node;
  66. }
  67. declare type PropOptions = {
  68. type: Function | Array<Function> | null;
  69. default: any;
  70. required: ?boolean;
  71. validator: ?Function;
  72. }