提交 67fc9575 编写于 作者: fxy060608's avatar fxy060608

feat(app): add navigateToMiniProgram

上级 ff263179
...@@ -243,7 +243,8 @@ const third = [ ...@@ -243,7 +243,8 @@ const third = [
'sendNativeEvent', 'sendNativeEvent',
'preloadPage', 'preloadPage',
'unPreloadPage', 'unPreloadPage',
'loadSubPackage' 'loadSubPackage',
'sendHostEvent'
] ]
const ad = [ const ad = [
......
...@@ -54,6 +54,7 @@ export * from './plugin/sub-nvue' ...@@ -54,6 +54,7 @@ export * from './plugin/sub-nvue'
export * from './plugin/on-native-event-receive' export * from './plugin/on-native-event-receive'
export * from './plugin/send-native-event' export * from './plugin/send-native-event'
export * from './plugin/load-sub-package' export * from './plugin/load-sub-package'
export * from './plugin/sdk'
export * from './route/navigate-back' export * from './route/navigate-back'
export * from './route/navigate-to' export * from './route/navigate-to'
......
import {
invoke
} from '../../bridge'
import {
sendNativeEvent
} from './send-native-event.js'
export const sendHostEvent = sendNativeEvent
export function navigateToMiniProgram (data, callbackId) {
sendHostEvent(
'navigateToMiniProgram',
data,
(res) => {
if (res.errMsg && res.errMsg.indexOf(':ok') === -1) {
return invoke(callbackId, {
errMsg: res.errMsg
})
}
invoke(callbackId, {
errMsg: 'navigateToMiniProgram:ok'
})
}
)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册