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.
27 lines
497 B
27 lines
497 B
import {
|
|
invoke
|
|
} from 'uni-core/service/bridge'
|
|
|
|
import {
|
|
getCurrentPageId
|
|
} from '../../platform'
|
|
|
|
UniServiceJSBridge.subscribe('onLoadFontFaceCallback', ({
|
|
callbackId,
|
|
data
|
|
}) => {
|
|
invoke(callbackId, data)
|
|
})
|
|
|
|
export function loadFontFace (options, callbackId) {
|
|
const pageId = getCurrentPageId()
|
|
if (!pageId) {
|
|
return {
|
|
errMsg: 'loadFontFace:fail not font page'
|
|
}
|
|
}
|
|
UniServiceJSBridge.publishHandler('loadFontFace', {
|
|
options,
|
|
callbackId
|
|
}, pageId)
|
|
}
|
|
|