Merge pull request #1130 from 2betop/ts-fix

升级到最新的 typescript,并修复错误
This commit is contained in:
吴多益 2020-12-02 16:31:00 +08:00 committed by GitHub
commit e692625457
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 6 deletions

View File

@ -158,9 +158,9 @@
"react-testing-library": "6.0.4",
"strip-json-comments": "^2.0.1",
"ts-jest": "^24.0.0",
"ts-json-schema-generator": "^0.73.0",
"ts-json-schema-generator": "^0.80.0",
"ts-node": "^9.0.0",
"typescript": "^4.0.2"
"typescript": "~4.1.2"
},
"jest": {
"testEnvironment": "jsdom",

View File

@ -181,7 +181,7 @@ export default class MatrixCheckbox extends React.Component<
}
// todo 优化这块
return await new Promise((resolve, reject) => {
return await new Promise<void>((resolve, reject) => {
if (!this.mounted) {
return resolve();
}
@ -228,7 +228,7 @@ export default class MatrixCheckbox extends React.Component<
error: reason,
loading: false
},
resolve
() => resolve()
)
);
}

View File

@ -125,7 +125,14 @@ export default class TextControl extends React.PureComponent<
}
componentDidMount() {
const {formItem, autoComplete, addHook, formInited, data} = this.props;
const {
formItem,
autoComplete,
addHook,
formInited,
data,
name
} = this.props;
if (isEffectiveApi(autoComplete, data) && formItem) {
if (formInited) {

View File

@ -1269,7 +1269,7 @@ export function mapObject(value: any, fn: Function): any {
}
export function loadScript(src: string) {
return new Promise((ok, fail) => {
return new Promise<void>((ok, fail) => {
const script = document.createElement('script');
script.onerror = reason => fail(reason);