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.
40 lines
907 B
40 lines
907 B
import initUni from './api/legacy/index'
|
|
import initUpx2px from './api/upx2px'
|
|
import initEventBus from './api/event-bus'
|
|
|
|
let getGlobalUni
|
|
let getGlobalApp
|
|
let getGlobalUniEmitter
|
|
let getGlobalCurrentPages
|
|
|
|
export function createInstanceContext () {
|
|
return {
|
|
initUniApp ({
|
|
nvue,
|
|
getUni,
|
|
getApp,
|
|
getUniEmitter,
|
|
getCurrentPages
|
|
}) {
|
|
getGlobalUni = getUni
|
|
getGlobalApp = getApp
|
|
getGlobalUniEmitter = getUniEmitter
|
|
getGlobalCurrentPages = getCurrentPages
|
|
|
|
initUpx2px(nvue)
|
|
initEventBus(getUniEmitter)
|
|
},
|
|
getUni (nvue, plus, BroadcastChannel) {
|
|
return initUni(getGlobalUni(), nvue, plus, BroadcastChannel)
|
|
},
|
|
getApp () {
|
|
return getGlobalApp()
|
|
},
|
|
getUniEmitter () {
|
|
return getGlobalUniEmitter()
|
|
},
|
|
getCurrentPages (returnAll) {
|
|
return getGlobalCurrentPages(returnAll)
|
|
}
|
|
}
|
|
}
|
|
|