fix: 修复 iframe postMessage 可能会报 could not be cloned 错问题 (#3919)

* fix: 修复 iframe posemessage 可能会报 could not be cloned 错问题

* 修复 iframe 链接错误
This commit is contained in:
吴多益 2022-03-31 14:11:39 +08:00 committed by GitHub
parent 1e1180614d
commit 9bb6e64efc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ order: 51
```schema: scope="body"
{
"type": "iframe",
"src": "https://gitee.com/baidu/amis",
"src": "https://github.com/baidu/amis",
"height": 300
}
```
@ -28,11 +28,11 @@ order: 51
{
"type": "page",
"data": {
"iframeSrc": "baidu/amis"
"iframeSrc": "https://github.com/baidu/amis"
},
"body": {
"type": "iframe",
"src": "https://gitee.com/${iframeSrc}",
"src": "${iframeSrc}",
"height": 300
}
}

View File

@ -137,7 +137,7 @@ export default class IFrame extends React.Component<IFrameProps, object> {
(this.IFrameRef.current as HTMLIFrameElement)?.contentWindow?.postMessage(
{
type: `amis:${type}`,
data
data: JSON.parse(JSON.stringify(data))
},
'*'
);