Showing 1 of 2 files from the diff.

@@ -20,33 +20,36 @@
Loading
20 20
  idCounter = 0;
21 21
}
22 22
23 -
const defaultData = {
24 -
  root: {
25 -
    children: [],
26 -
  },
27 -
  modalRoot: {
28 -
    children: [],
29 -
  },
30 -
};
31 -
32 -
const defaultLifecycleCallback: any = {};
33 -
34 23
export default function createPageConfig(Page: React.ComponentType<any>, name: string) {
35 24
  const app = getApp() as any;
36 25
37 26
  const config: any = {
38 -
    data: defaultData,
27 +
    data: {
28 +
      root: {
29 +
        children: [],
30 +
      },
31 +
      modalRoot: {
32 +
        children: [],
33 +
      },
34 +
    },
39 35
40 36
    wrapperRef: React.createRef<any>(),
41 37
42 -
    lifecycleCallback: defaultLifecycleCallback,
38 +
    lifecycleCallback: {},
43 39
44 40
    onLoad(this: any, query: any) {
45 41
      const PageWrapper = createPageWrapper(Page, name);
46 42
      this.pageId = generatePageId();
47 43
48 -
      this.lifecycleCallback = defaultLifecycleCallback;
49 -
      this.data = defaultData;
44 +
      this.lifecycleCallback = {};
45 +
      this.data = {
46 +
        root: {
47 +
          children: [],
48 +
        },
49 +
        modalRoot: {
50 +
          children: [],
51 +
        },
52 +
      };
50 53
51 54
      this.query = query;
52 55
      this.container = new Container(this, 'root');
@@ -114,25 +117,25 @@
Loading
114 117
    events: {
115 118
      // 页面返回时触发
116 119
      onBack(this: any, e: any) {
117 -
        return config.callLifecycle(Lifecycle.back, e);
120 +
        return this.callLifecycle(Lifecycle.back, e);
118 121
      },
119 122
120 123
      // 键盘高度变化时触发
121 124
      onKeyboardHeight(this: any, e: any) {
122 -
        return config.callLifecycle(Lifecycle.keyboardHeight, e);
125 +
        return this.callLifecycle(Lifecycle.keyboardHeight, e);
123 126
      },
124 127
125 128
      onTabItemTap(this: any, e: any) {
126 -
        return config.callLifecycle(Lifecycle.tabItemTap, e);
129 +
        return this.callLifecycle(Lifecycle.tabItemTap, e);
127 130
      },
128 131
129 132
      // 点击但切换tabItem前触发
130 133
      beforeTabItemTap(this: any) {
131 -
        return config.callLifecycle(Lifecycle.beforeTabItemTap);
134 +
        return this.callLifecycle(Lifecycle.beforeTabItemTap);
132 135
      },
133 136
134 137
      onResize(this: any, e: any) {
135 -
        return config.callLifecycle(Lifecycle.resize, e);
138 +
        return this.callLifecycle(Lifecycle.resize, e);
136 139
      },
137 140
    },
138 141
Files Coverage
packages 95.37%
Project Totals (350 files) 95.37%
6458.1
TRAVIS_OS_NAME=linux
stable=

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading