Skip to content

Commit

Permalink
fix: 修复 card 组件渲染异常 Close: baidu#10229 (baidu#10258)
Browse files Browse the repository at this point in the history
  • Loading branch information
2betop authored and yupeng12 committed May 21, 2024
1 parent 28f915b commit 0ed0a7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions packages/amis-core/src/utils/style-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,12 @@ export function insertEditCustomStyle(params: {

insertStyle({
style: content,
classId: 'wrapperCustomStyle-' + (id?.replace('u:', '') || uuid()) + index,
classId:
'wrapperCustomStyle-' +
((typeof id === 'string' ? id.replace('u:', '') : '') || uuid()) +
index,
doc,
id: id?.replace('u:', '').replace(/(-.*)/, '')
id: typeof id === 'string' ? id.replace('u:', '').replace(/(-.*)/, '') : ''
});
}

Expand Down
6 changes: 5 additions & 1 deletion packages/amis/src/renderers/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,11 @@ export class CardRenderer extends React.Component<CardProps> {
const {subTitle: subTitleTpl} = header || {};

// const subTitle = filter(subTitleTpl, data);
return subTitleTpl ? render('sub-title', subTitleTpl, data) : undefined;
return subTitleTpl
? render('sub-title', subTitleTpl, {
data
})
: undefined;
}
return;
}
Expand Down

0 comments on commit 0ed0a7e

Please sign in to comment.