fix some warning

This commit is contained in:
yupeng12 2024-07-01 17:03:09 +08:00
parent c953d6a3e3
commit 6b9a368e44
3 changed files with 11 additions and 15 deletions

View File

@ -219,7 +219,7 @@ export function renderChild(
<StatusScopedSchemaRenderer
render={renderChild as any}
{...props}
key={schema.key}
key={props.key}
schema={schema}
propKey={schema.key}
$path={`${prefix ? `${prefix}/` : ''}${(schema && schema.type) || ''}`}
@ -231,7 +231,7 @@ export function renderChild(
<SchemaRenderer
render={renderChild as any}
{...props}
key={schema.key}
key={props.key}
schema={schema}
propKey={schema.key}
$path={`${prefix ? `${prefix}/` : ''}${(schema && schema.type) || ''}`}

View File

@ -428,10 +428,10 @@ export class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
const {
data: defaultData,
value: defaultValue,
key: propKey,
activeKey: defaultActiveKey,
...restSchema
} = schema;
const propKey = schema.key ?? this.props.key;
const Component = renderer.component;
// 原来表单项的 visible: false 和 hidden: true 表单项的值和验证是有效的

View File

@ -549,18 +549,14 @@ export default class Drawer extends React.Component<DrawerProps> {
</div>
) : null}
{actions.map((action, key) =>
render(
`action/${key}`,
{key, ...action},
{
onAction: this.handleAction,
onActionSensor: undefined,
btnDisabled: store.loading,
data: store.formData,
key,
disabled: action.disabled || store.loading
}
)
render(`action/${key}`, action, {
onAction: this.handleAction,
onActionSensor: undefined,
btnDisabled: store.loading,
data: store.formData,
key,
disabled: action.disabled || store.loading
})
)}
</div>
);