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

@@ -14,16 +14,21 @@
* limitations under the License.
*/
import { BridgeContext } from "../runtime/global"
import { ClassType } from "../pattern/mvvm"
import { Panel } from "../ui/panel"
export function navigator(context: BridgeContext) {
const moduleName = "navigator"
return {
push: (source: string, config?: {
push: (source: string | ClassType<Panel>, config?: {
alias?: string,
animated?: boolean,
extra?: object,
singlePage?: boolean,
}) => {
if (typeof source === 'function') {
source = `_internal_://export?class=${encodeURIComponent(source.name)}&context=${context.id}`
}
if (config && config.extra) {
(config as any).extra = JSON.stringify(config.extra)
}