navigator add openUrl

This commit is contained in:
pengfei.zhou
2020-04-01 15:19:37 +08:00
committed by osborn
parent 9c520e1dc5
commit 78d4f51314
12 changed files with 78 additions and 13 deletions

View File

@@ -3521,17 +3521,21 @@ function navbar(context) {
}
function navigator(context) {
const moduleName = "navigator";
return {
push: (source, config) => {
if (config && config.extra) {
config.extra = JSON.stringify(config.extra);
}
return context.callNative('navigator', 'push', {
return context.callNative(moduleName, 'push', {
source, config
});
},
pop: (animated = true) => {
return context.callNative('navigator', 'pop', { animated });
return context.callNative(moduleName, 'pop', { animated });
},
openUrl: (url) => {
return context.callNative(moduleName, "openUrl", url);
},
};
}

File diff suppressed because one or more lines are too long