windows自定义监听事件传值


    const callbackFun = (e) => {
      console.log('commonUpdateInLifeCycle: e', e);
      let { detail } = e;
     
      console.log(detail)
    }

window.addEventListener('commonUpdateInLifeCycle', callbackFun);

 window.dispatchEvent(new CustomEvent('commonUpdateInLifeCycle', { detail: {forceUpdate: false, DBcheck: true} }));

 

你可能感兴趣的:(windows自定义监听事件传值)