From 659ab3d9c78c1625f7822f519589535f52fb6509 Mon Sep 17 00:00:00 2001 From: rickcole Date: Tue, 21 Jul 2020 17:33:07 +0800 Subject: [PATCH] change event name --- docs/renderers/iFrame.md | 2 +- src/renderers/IFrame.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/renderers/iFrame.md b/docs/renderers/iFrame.md index 52fa51c3..47f267a6 100644 --- a/docs/renderers/iFrame.md +++ b/docs/renderers/iFrame.md @@ -26,7 +26,7 @@ window.addEventListener('message', e => { ```json { - "type": "amis:load", // 当前事件类型 + "type": "amis:init", // 当前事件类型 "data": { //... 当前数据域数据 } diff --git a/src/renderers/IFrame.tsx b/src/renderers/IFrame.tsx index 90930620..edda5fb3 100644 --- a/src/renderers/IFrame.tsx +++ b/src/renderers/IFrame.tsx @@ -70,7 +70,7 @@ export default class IFrame extends React.Component { @autobind onLoad() { const {src, data} = this.props; - src && this.postMessage('load', data); + src && this.postMessage('init', data); } // 当别的组件通知 iframe reload 的时候执行。