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

@@ -1,6 +1,7 @@
import { BridgeContext } from "../runtime/global";
import { ClassType } from "../pattern/mvvm";
import { Panel } from "../ui/panel";
export declare function internalScheme(context: BridgeContext, panelClass: ClassType<Panel>): string;
export declare function navigator(context: BridgeContext): {
push: (source: string | ClassType<Panel>, config?: {
alias?: string | undefined;

View File

@@ -1,9 +1,12 @@
export function internalScheme(context, panelClass) {
return `_internal_://export?class=${encodeURIComponent(panelClass.name)}&context=${context.id}`;
}
export function navigator(context) {
const moduleName = "navigator";
return {
push: (source, config) => {
if (typeof source === 'function') {
source = `_internal_://export?class=${encodeURIComponent(source.name)}&context=${context.id}`;
source = internalScheme(context, source);
}
if (config && config.extra) {
config.extra = JSON.stringify(config.extra);