mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:18:34 +08:00
补充容错 (#2059)
This commit is contained in:
parent
d1a4cad499
commit
df1a4bb54b
@ -124,6 +124,11 @@ export function renderChild(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const typeofnode = typeof node;
|
const typeofnode = typeof node;
|
||||||
|
|
||||||
|
if (typeofnode === 'undefined' || node === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
let schema: Schema =
|
let schema: Schema =
|
||||||
typeofnode === 'string' || typeofnode === 'number'
|
typeofnode === 'string' || typeofnode === 'number'
|
||||||
? {type: 'tpl', tpl: String(node)}
|
? {type: 'tpl', tpl: String(node)}
|
||||||
|
@ -489,7 +489,7 @@ addSchemaFilter(function (schema: Schema, renderer: any, props: any) {
|
|||||||
return schema;
|
return schema;
|
||||||
|
|
||||||
function controlToNormalRenderer(item: any) {
|
function controlToNormalRenderer(item: any) {
|
||||||
if (item.$ref && props.resolveDefinitions) {
|
if (item?.$ref && props.resolveDefinitions) {
|
||||||
item = {
|
item = {
|
||||||
...props.resolveDefinitions(item.$ref),
|
...props.resolveDefinitions(item.$ref),
|
||||||
...item
|
...item
|
||||||
|
@ -811,6 +811,10 @@ export default class Form extends React.Component<FormProps, object> {
|
|||||||
) {
|
) {
|
||||||
const {store, formLazyChange} = this.props;
|
const {store, formLazyChange} = this.props;
|
||||||
|
|
||||||
|
if (typeof name !== 'string') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
store.changeValue(name, value, changePristine);
|
store.changeValue(name, value, changePristine);
|
||||||
|
|
||||||
(formLazyChange === false ? this.emitChange : this.lazyEmitChange)(submit);
|
(formLazyChange === false ? this.emitChange : this.lazyEmitChange)(submit);
|
||||||
|
Loading…
Reference in New Issue
Block a user