maishu-chitu-react
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -10,6 +10,6 @@ import React = require("react"); | ||
export declare class Page extends chitu.Page { | ||
component: React.Component; | ||
component: React.Component | null; | ||
} | ||
export declare class Application extends chitu.Application { | ||
protected createDefaultAction(url: string, loadjs: (path: string) => Promise<any>): (page: Page) => Promise<React.FunctionComponentElement<PageProps>>; | ||
protected createDefaultAction(url: string, loadjs: (path: string) => Promise<any>): chitu.Action; | ||
} |
@@ -24,2 +24,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
class Page extends chitu.Page { | ||
constructor() { | ||
super(...arguments); | ||
this.component = null; | ||
} | ||
} | ||
@@ -38,8 +42,6 @@ exports.Page = Page; | ||
let action; | ||
if (chitu.PageMaster.isClass(_action)) { | ||
action = _action; | ||
if (!chitu.PageMaster.isClass(_action)) { | ||
return _action(page, this); | ||
} | ||
else { | ||
action = _action; | ||
} | ||
action = _action; | ||
let app = this; | ||
@@ -57,3 +59,2 @@ let props = { | ||
page.component = component; | ||
return element; | ||
}); | ||
@@ -60,0 +61,0 @@ } |
{ | ||
"name": "maishu-chitu-react", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
@@ -6,3 +6,3 @@ import React = require("react"); | ||
type LoadJS = (path: string) => Promise<{ | ||
defalut: (props: any, app: chitu.PageMaster) => React.ReactElement<any> | { | ||
default: (props: any, app: chitu.PageMaster) => React.ReactElement<any> | { | ||
new(props: any, app: chitu.PageMaster): React.ReactElement<any>; | ||
@@ -20,8 +20,8 @@ }; | ||
export class Page extends chitu.Page { | ||
component: React.Component | ||
component: React.Component | null = null | ||
} | ||
export class Application extends chitu.Application { | ||
protected createDefaultAction(url: string, loadjs: (path: string) => Promise<any>) { | ||
return async (page: Page) => { | ||
protected createDefaultAction(url: string, loadjs: (path: string) => Promise<any>): chitu.Action { | ||
return async (page: chitu.Page) => { | ||
let actionExports = await (loadjs as LoadJS)(url); | ||
@@ -38,5 +38,5 @@ if (!actionExports) | ||
if (!chitu.PageMaster.isClass(_action)) { | ||
return _action(page) | ||
return _action(page, this) | ||
} | ||
action = _action as any | ||
@@ -54,3 +54,3 @@ let app = this as Application | ||
let component = ReactDOM.render(element, page.element) as any as React.Component | ||
page.component = component | ||
(page as Page).component = component | ||
} | ||
@@ -57,0 +57,0 @@ } |
@@ -12,4 +12,5 @@ { | ||
] | ||
} | ||
}, | ||
"strict": true | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
314511
1087