mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: 修复当 toast 内容是个对象时不显示问题 (#4528)
Co-authored-by: liaoxuezhi <2betop.cn@gmail.com>
This commit is contained in:
parent
6df8179193
commit
a35ca4e477
@ -12,7 +12,8 @@
|
||||
"stop": "fis3 server stop",
|
||||
"dev": "fis3 release -cwd ./public",
|
||||
"deploy-gh-page": "sh ./deploy-gh-pages.sh",
|
||||
"test": "jest",
|
||||
"test": "npm test --workspaces",
|
||||
"prepare": "husky install"
|
||||
"coverage": "jest --coverage",
|
||||
"release": "lerna publish",
|
||||
"release:beta": "lerna publish --canary --pre-dist-tag=beta --preid beta --yes"
|
||||
@ -33,6 +34,7 @@
|
||||
"fis3-prepackager-stand-alone-pack": "^1.0.0",
|
||||
"fis3-preprocessor-js-require-css": "^0.1.3",
|
||||
"fis3-preprocessor-js-require-file": "^0.1.3",
|
||||
"husky": "^8.0.0"
|
||||
"jest": "^28.1.0",
|
||||
"jest-environment-jsdom": "^28.1.0",
|
||||
"lerna": "^5.0.0",
|
||||
|
@ -388,14 +388,18 @@ export class ToastMessage extends React.Component<
|
||||
})
|
||||
) : null}
|
||||
|
||||
{typeof body === 'string' ? (
|
||||
<div className={cx('Toast-body')}>
|
||||
{allowHtml ? <Html html={body} /> : body}
|
||||
</div>
|
||||
) : React.isValidElement(body) ? (
|
||||
{React.isValidElement(body) ? (
|
||||
React.cloneElement(body, {
|
||||
className: cx(`Toast-body`, body?.props?.className ?? '')
|
||||
})
|
||||
) : typeof body === 'string' || typeof body === 'object' ? (
|
||||
<div className={cx('Toast-body')}>
|
||||
{allowHtml ? (
|
||||
<Html html={body?.toString()} />
|
||||
) : (
|
||||
body?.toString()
|
||||
)}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user