Skip to content

Commit

Permalink
fix: 修复 log 的 source 是 api object 时不自动加载的问题 (baidu#9509)
Browse files Browse the repository at this point in the history
  • Loading branch information
2betop committed Jan 25, 2024
1 parent 80610ec commit 7c79a84
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/amis/src/renderers/Log.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,14 @@ export class Log extends React.Component<LogProps, LogState> {
);
}
if (this.props.source) {
const ret = resolveVariableAndFilter(
this.props.source,
this.props.data,
'| raw'
);
const ret =
typeof this.props.source === 'string'
? resolveVariableAndFilter(
this.props.source,
this.props.data,
'| raw'
)
: this.props.source;
if (ret && isEffectiveApi(ret)) {
this.loadLogs();
} else if (
Expand All @@ -187,11 +190,10 @@ export class Log extends React.Component<LogProps, LogState> {
return;
}

const ret = resolveVariableAndFilter(
this.props.source,
this.props.data,
'| raw'
);
const ret =
typeof this.props.source === 'string'
? resolveVariableAndFilter(this.props.source, this.props.data, '| raw')
: this.props.source;

if (ret && isEffectiveApi(ret)) {
// todo 如果原来的请求还在,应该先取消
Expand Down

0 comments on commit 7c79a84

Please sign in to comment.