import messager from '../common/messager';

/**
 * 生命周期
 */

const onLoad = () => {
  messager.emit('frame.load');
};

export default {
  init() {
    // 通知外层页面加载成功
    if (document.readyState === 'complete') {
      return onLoad();
    }
    window.addEventListener('load', () => onLoad({}));
  }
}