vnode.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. declare type VNodeChildren = Array<?VNode | string | VNodeChildren> | string
  2. declare type VNodeComponentOptions = {
  3. Ctor: Class<Component>;
  4. propsData: ?Object;
  5. listeners: ?Object;
  6. children: ?Array<VNode>;
  7. tag?: string;
  8. }
  9. declare type MountedComponentVNode = {
  10. componentOptions: VNodeComponentOptions;
  11. componentInstance: Component;
  12. parent: VNode;
  13. data: VNodeData;
  14. }
  15. // interface for vnodes in update modules
  16. declare type VNodeWithData = {
  17. tag: string;
  18. data: VNodeData;
  19. children: ?Array<VNode>;
  20. text: void;
  21. elm: any;
  22. ns: string | void;
  23. context: Component;
  24. key: string | number | void;
  25. parent?: VNodeWithData;
  26. componentInstance?: Component;
  27. isRootInsert: boolean;
  28. }
  29. declare interface VNodeData {
  30. key?: string | number;
  31. slot?: string;
  32. ref?: string;
  33. pre?: boolean;
  34. tag?: string;
  35. staticClass?: string;
  36. class?: any;
  37. staticStyle?: { [key: string]: any };
  38. style?: Array<Object> | Object;
  39. props?: { [key: string]: any };
  40. attrs?: { [key: string]: string };
  41. domProps?: { [key: string]: any };
  42. hook?: { [key: string]: Function };
  43. on?: ?{ [key: string]: Function | Array<Function> };
  44. nativeOn?: { [key: string]: Function | Array<Function> };
  45. transition?: Object;
  46. show?: boolean; // marker for v-show
  47. inlineTemplate?: {
  48. render: Function;
  49. staticRenderFns: Array<Function>;
  50. };
  51. directives?: Array<VNodeDirective>;
  52. keepAlive?: boolean;
  53. scopedSlots?: { [key: string]: Function };
  54. model?: {
  55. value: any;
  56. callback: Function;
  57. };
  58. }
  59. declare type VNodeDirective = {
  60. name: string;
  61. rawName: string;
  62. value?: any;
  63. oldValue?: any;
  64. arg?: string;
  65. modifiers?: ASTModifiers;
  66. def?: Object;
  67. }