maishu-chitu-react
Advanced tools
Comparing version 1.0.3 to 1.0.4
import React = require("react"); | ||
import * as chitu from 'maishu-chitu'; | ||
export declare class Application extends chitu.Application { | ||
createDefaultAction(url: string, loadjs: (path: string) => Promise<any>): (page: chitu.Page) => Promise<React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>>; | ||
protected createDefaultAction(url: string, loadjs: (path: string) => Promise<any>): (page: chitu.Page) => Promise<React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>>; | ||
} |
@@ -29,3 +29,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
throw chitu.Errors.exportsCanntNull(url); | ||
let _action = actionExports['defalut']; | ||
let _action = actionExports['default']; | ||
if (_action == null) { | ||
@@ -41,3 +41,5 @@ throw chitu.Errors.canntFindAction(page.name); | ||
} | ||
let element = React.createElement(action, page.data); | ||
let app = this; | ||
let props = Object.assign({}, page.data, { app }); | ||
let element = React.createElement(action, props); | ||
ReactDOM.render(element, page.element); | ||
@@ -44,0 +46,0 @@ return element; |
@@ -12,3 +12,3 @@ import React = require("react"); | ||
export class Application extends chitu.Application { | ||
createDefaultAction(url: string, loadjs: (path: string) => Promise<any>) { | ||
protected createDefaultAction(url: string, loadjs: (path: string) => Promise<any>) { | ||
return async (page: chitu.Page) => { | ||
@@ -19,3 +19,3 @@ let actionExports = await (loadjs as LoadJS)(url); | ||
let _action = actionExports['defalut'] | ||
let _action = actionExports['default'] | ||
if (_action == null) { | ||
@@ -33,3 +33,5 @@ throw chitu.Errors.canntFindAction(page.name); | ||
let element = React.createElement(action, page.data) | ||
let app = this as Application | ||
let props = Object.assign({}, page.data, { app }) | ||
let element = React.createElement(action, props) | ||
ReactDOM.render(element, page.element) | ||
@@ -36,0 +38,0 @@ return element; |
{ | ||
"name": "maishu-chitu-react", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -22,4 +22,4 @@ "main": "index.js", | ||
"@types/react-dom": "^16.0.11", | ||
"maishu-chitu": "^2.0.6" | ||
"maishu-chitu": "^2.0.7" | ||
} | ||
} |
@@ -9,3 +9,4 @@ { | ||
"maishu-chitu": [ | ||
"node_modules/maishu-chitu/dist/chitu.d.ts" | ||
"node_modules/maishu-chitu/dist/chitu.d.ts", | ||
"../maishu-chitu/dist/chitu.d.ts" | ||
] | ||
@@ -12,0 +13,0 @@ } |
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
4897
100
Updatedmaishu-chitu@^2.0.7