提交 be89a303 编写于 作者: Q qiang

fix: platform.js

上级 ac3719f7
import { import {
APP_SERVICE_ID APP_SERVICE_ID
} from '../constants' } from '../constants'
import {
function plusReady (callback) { plusReady
if (!callback) { } from 'uni-shared'
return
}
if (window.plus) {
return callback()
}
document.addEventListener('plusready', callback)
}
export function publishHandler (event, args = {}) { export function publishHandler (event, args = {}) {
plusReady(function () { plusReady(function () {
...@@ -27,4 +20,4 @@ export function publishHandler (event, args = {}) { ...@@ -27,4 +20,4 @@ export function publishHandler (event, args = {}) {
} }
}, APP_SERVICE_ID) }, APP_SERVICE_ID)
}) })
} }
export function plusReady (callback) {
if (typeof callback !== 'function') {
return
}
if (window.plus) {
return callback()
}
document.addEventListener('plusready', callback)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册