Skip to content

Commit

Permalink
fix: examples update
Browse files Browse the repository at this point in the history
  • Loading branch information
kongxiaojun committed Aug 7, 2024
1 parent a745c37 commit d81023d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
13 changes: 6 additions & 7 deletions examples/mini-program-example/src/pages/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,20 @@ export default function Index() {
</Button>
<Button
onClick={()=>{
nativeApi.harmonyNavigateTo({
indexHtmlPath: '/spa/new/index.html',
taroPath: 'pages/performance/index/index'
Taro.navigateTo({
url: 'pages/harmony-hybrid/mix-router/home/index'
})
}}>
多实例(多SPA跳转):性能列表页
多实例及混合路由测试页
</Button>
<Button
onClick={()=>{
nativeApi.harmonyNavigateTo({
nativeApi.navigateToTaroHybrid({
indexHtmlPath: '/spa/new/index.html',
taroPath: '/pages/api/index/index'
taroPath: '/pages/index/index'
})
}}>
单实例(单SPA):接口列表页
单实例(单SPA):首页
</Button>
</View>
)
Expand Down
13 changes: 7 additions & 6 deletions examples/mini-program-example/src/util/nativeApi.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// @ts-ignore
const decorator = window.MethodChannel && window.MethodChannel.jsBridgeMode({ isAsync: false, autoRelease: true }) || (target => target)
const sync = window.MethodChannel && window.MethodChannel.jsBridgeMode({ isAsync: false, autoRelease: true }) || (target => target)

// @proxyClassSign('')
class NativeApi {
// @ts-ignore
@decorator
harmonyNavigateTo(options: any) {
return options
}
@sync
navigateToTaroHybrid(_options: any) {}


@sync
navigateToNative(_options: any){}
}

const nativeApi = new NativeApi()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,12 +757,7 @@
"TARO_ENV": true,
"USER_DATA_PATH": true
},
"exitMiniProgram": {
"object": {
"url": true,
"events": true
}
},
"exitMiniProgram": true,
"exitVoIPChat": false,
"faceDetect": false,
"faceVerifyForPay": false,
Expand Down

0 comments on commit d81023d

Please sign in to comment.