2.0.7 • Published 4 months ago

@fle-tools/pm v2.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

@fle-tools/pm

Based Post Message

Installation

Install via your package manager

npm i @fle-tools/pm

# or

yarn add @fle-tools/pm

Usage

// 父应用
import PM = from '@fle-tools/pm';

const Message = new Message({
  targetOrigin: '*',
  isLogger: true,
})

Message.emit({
  type: 'ADD_TODO',
  payload: {
    test: 'test'
  }
});

Message.on('ADD_TODO', (payload) => {
  console.log(payload);
});

Message.destroy();

子应用

API

参数名必填类型默认值备注
iframeIdfalsestringfle_pm__IframeiframeId
identitytrue'parent'|'child''parent'当前所处身份 是父应用 还是子应用
hosttruestring'‘应用host。

Action

事件名必填类型备注
onfalsefunction监听message
emitfalsefunction发送message
destroyfalsefunction销毁message监听
2.0.7

4 months ago

2.0.5

1 year ago

2.0.4

2 years ago

2.0.3

3 years ago

2.0.2

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago