注册回调事件
import { MJMLink } from "@yl/super-jssdk"
MJMLink.registerCallback(optional)
| 参数 | 类型 | 必填 | 作用 |
|---|---|---|---|
| optional | Object | 否 | 选填参数 |
optional
| 参数 | 类型 | 必填 | 作用 |
|---|---|---|---|
| type | string | 否 | 调用插件类型,可选:jmlink、magic-window,默认 jmlink |
| 参数 | 类型 | 作用 |
|---|---|---|
| resolve() | Function | 成功回调 |
| reject(err) | Function | 失败回调,err为详细错误信息,是一个json对象,例如:{"errCode":-1,"errMsg":"出错啦"} |
MJMLink.registerCallback()
.then((res) => {
console.log(res);
})
.catch(err => {
console.log('插件调用失败:', err)
})