iOS support internal class

This commit is contained in:
pengfei.zhou
2020-09-04 18:51:08 +08:00
committed by osborn
parent 4df7df1327
commit 821cb1823c
11 changed files with 70 additions and 77 deletions

View File

@@ -17,6 +17,10 @@ import { BridgeContext } from "../runtime/global"
import { ClassType } from "../pattern/mvvm"
import { Panel } from "../ui/panel"
export function internalScheme(context: BridgeContext, panelClass: ClassType<Panel>) {
return `_internal_://export?class=${encodeURIComponent(panelClass.name)}&context=${context.id}`
}
export function navigator(context: BridgeContext) {
const moduleName = "navigator"
return {
@@ -27,7 +31,7 @@ export function navigator(context: BridgeContext) {
singlePage?: boolean,
}) => {
if (typeof source === 'function') {
source = `_internal_://export?class=${encodeURIComponent(source.name)}&context=${context.id}`
source = internalScheme(context, source)
}
if (config && config.extra) {
(config as any).extra = JSON.stringify(config.extra)