智能照明系统APP-本地串口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LightingSystemApp-serial/.svn/pristine/c8/c8018da654b8840535c262a4b1f...

16 lines
381 B

3 years ago
import {
invoke
} from 'uni-core/service/bridge'
const callbacks = []
// 不使用uni-core/service/platform中的onMethod,避免循环引用
UniServiceJSBridge.on('api.uniMPNativeEvent', function (res) {
callbacks.forEach(callbackId => {
invoke(callbackId, res.event, res.data)
})
})
export function onNativeEventReceive (callbackId) {
callbacks.push(callbackId)
}