Android support internal class

This commit is contained in:
pengfei.zhou
2020-09-04 18:22:45 +08:00
committed by osborn
parent a211ac8acb
commit 4df7df1327
16 changed files with 343 additions and 48 deletions

View File

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

View File

@@ -2,6 +2,9 @@ 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}`;
}
if (config && config.extra) {
config.extra = JSON.stringify(config.extra);
}