hybrid-navigation 2.4.2 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnative/hybridnavigation/Constants.java +1 -2
- package/android/src/main/java/com/reactnative/hybridnavigation/Garden.java +13 -2
- package/android/src/main/java/com/reactnative/hybridnavigation/GardenModule.java +12 -29
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactTabBar.java +0 -3
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactTabBarFragment.java +47 -49
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactTabBarProvider.java +35 -55
- package/docs/README.md +3 -3
- package/docs/custom-tabbar.md +1 -1
- package/docs/deeplink.md +1 -1
- package/docs/integration-native.md +2 -2
- package/docs/integration-react.md +1 -1
- package/docs/qa.md +17 -0
- package/docs/style.md +52 -67
- package/ios/HybridNavigation/Bridge/HBDGardenModule.m +3 -13
- package/ios/HybridNavigation/HBDUtils.m +0 -8
- package/ios/HybridNavigation/View/HBDNavigationBar.h +1 -0
- package/ios/HybridNavigation/View/HBDNavigationBar.m +4 -0
- package/ios/HybridNavigation/ViewController/HBDNavigationController.m +27 -14
- package/ios/HybridNavigation/ViewController/HBDTabBarController.h +1 -3
- package/ios/HybridNavigation/ViewController/HBDTabBarController.m +34 -33
- package/ios/HybridNavigation/ViewController/HBDViewController.m +5 -0
- package/ios/HybridNavigation/ViewController/UIViewController+HBD.m +49 -18
- package/lib/Garden.d.ts +14 -0
- package/lib/Garden.js +33 -2
- package/lib/typing.d.ts +1 -0
- package/package.json +7 -7
- package/docs/.vuepress/.cache/default-development/0.pack +0 -0
- package/docs/.vuepress/.cache/default-development/1.pack +0 -0
- package/docs/.vuepress/.cache/default-development/10.pack +0 -0
- package/docs/.vuepress/.cache/default-development/11.pack +0 -0
- package/docs/.vuepress/.cache/default-development/12.pack +0 -0
- package/docs/.vuepress/.cache/default-development/13.pack +0 -0
- package/docs/.vuepress/.cache/default-development/14.pack +0 -0
- package/docs/.vuepress/.cache/default-development/15.pack +0 -0
- package/docs/.vuepress/.cache/default-development/16.pack +0 -0
- package/docs/.vuepress/.cache/default-development/17.pack +0 -0
- package/docs/.vuepress/.cache/default-development/18.pack +0 -0
- package/docs/.vuepress/.cache/default-development/19.pack +0 -0
- package/docs/.vuepress/.cache/default-development/2.pack +0 -0
- package/docs/.vuepress/.cache/default-development/20.pack +0 -0
- package/docs/.vuepress/.cache/default-development/21.pack +0 -0
- package/docs/.vuepress/.cache/default-development/3.pack +0 -0
- package/docs/.vuepress/.cache/default-development/4.pack +0 -0
- package/docs/.vuepress/.cache/default-development/5.pack +0 -0
- package/docs/.vuepress/.cache/default-development/6.pack +0 -0
- package/docs/.vuepress/.cache/default-development/7.pack +0 -0
- package/docs/.vuepress/.cache/default-development/8.pack +0 -0
- package/docs/.vuepress/.cache/default-development/9.pack +0 -0
- package/docs/.vuepress/.cache/default-development/index.pack +0 -0
- package/docs/.vuepress/.cache/default-development/index.pack.old +0 -0
- package/docs/.vuepress/.cache/default-production/0.pack +0 -0
- package/docs/.vuepress/.cache/default-production/1.pack +0 -0
- package/docs/.vuepress/.cache/default-production/2.pack +0 -0
- package/docs/.vuepress/.cache/default-production/index.pack +0 -0
- package/docs/.vuepress/.cache/default-production/index.pack.old +0 -0
- package/docs/.vuepress/.temp/internal/clientAppEnhances.js +0 -9
- package/docs/.vuepress/.temp/internal/clientAppRootComponents.js +0 -5
- package/docs/.vuepress/.temp/internal/clientAppSetups.js +0 -9
- package/docs/.vuepress/.temp/internal/layoutComponents.js +0 -6
- package/docs/.vuepress/.temp/internal/pagesComponents.js +0 -26
- package/docs/.vuepress/.temp/internal/pagesData.js +0 -24
- package/docs/.vuepress/.temp/internal/pagesRoutes.js +0 -40
- package/docs/.vuepress/.temp/internal/siteData.js +0 -8
- package/docs/.vuepress/.temp/internal/themeData.js +0 -75
- package/docs/.vuepress/.temp/pages/404.html.js +0 -13
- package/docs/.vuepress/.temp/pages/404.html.vue +0 -1
- package/docs/.vuepress/.temp/pages/custom-tabbar.html.js +0 -32
- package/docs/.vuepress/.temp/pages/custom-tabbar.html.vue +0 -107
- package/docs/.vuepress/.temp/pages/deeplink.html.js +0 -50
- package/docs/.vuepress/.temp/pages/deeplink.html.vue +0 -93
- package/docs/.vuepress/.temp/pages/index.html.js +0 -51
- package/docs/.vuepress/.temp/pages/index.html.vue +0 -95
- package/docs/.vuepress/.temp/pages/integration-native.html.js +0 -38
- package/docs/.vuepress/.temp/pages/integration-native.html.vue +0 -292
- package/docs/.vuepress/.temp/pages/integration-react.html.js +0 -57
- package/docs/.vuepress/.temp/pages/integration-react.html.vue +0 -133
- package/docs/.vuepress/.temp/pages/lifecycle.html.js +0 -26
- package/docs/.vuepress/.temp/pages/lifecycle.html.vue +0 -69
- package/docs/.vuepress/.temp/pages/navigation.html.js +0 -50
- package/docs/.vuepress/.temp/pages/navigation.html.vue +0 -406
- package/docs/.vuepress/.temp/pages/pass-and-return-value.html.js +0 -51
- package/docs/.vuepress/.temp/pages/pass-and-return-value.html.vue +0 -94
- package/docs/.vuepress/.temp/pages/qa.html.js +0 -26
- package/docs/.vuepress/.temp/pages/qa.html.vue +0 -27
- package/docs/.vuepress/.temp/pages/style.html.js +0 -45
- package/docs/.vuepress/.temp/pages/style.html.vue +0 -452
- package/docs/.vuepress/.temp/styles/index.scss +0 -0
- package/docs/.vuepress/.temp/styles/palette.scss +0 -0
- package/docs/.vuepress/config.js +0 -51
- package/docs/.vuepress/dist/404.html +0 -15
- package/docs/.vuepress/dist/assets/css/styles.701e6109.css +0 -8
- package/docs/.vuepress/dist/assets/img/android.e350dcdd.png +0 -0
- package/docs/.vuepress/dist/assets/img/back-to-top.8b37f773.svg +0 -1
- package/docs/.vuepress/dist/assets/img/controller-base.96c0200f.jpg +0 -0
- package/docs/.vuepress/dist/assets/img/ios-react-script.6692a449.png +0 -0
- package/docs/.vuepress/dist/assets/img/ios-run-script.67339d42.jpg +0 -0
- package/docs/.vuepress/dist/assets/img/statusbar-inperfect.f32cfca0.png +0 -0
- package/docs/.vuepress/dist/assets/img/statusbar-setup-step-1.2669257d.png +0 -0
- package/docs/.vuepress/dist/assets/img/statusbar-setup-step-2.b18151ed.png +0 -0
- package/docs/.vuepress/dist/assets/img/tabbar.73212e13.jpg +0 -0
- package/docs/.vuepress/dist/assets/img/topbar-default.65d36143.png +0 -0
- package/docs/.vuepress/dist/assets/img/xcode-linking.685ce6ea.png +0 -0
- package/docs/.vuepress/dist/assets/js/293.071a173a.js +0 -1
- package/docs/.vuepress/dist/assets/js/491.4e0b3b61.js +0 -1
- package/docs/.vuepress/dist/assets/js/812.0c9a2f53.js +0 -2
- package/docs/.vuepress/dist/assets/js/812.0c9a2f53.js.LICENSE.txt +0 -8
- package/docs/.vuepress/dist/assets/js/app.a66f731a.js +0 -1
- package/docs/.vuepress/dist/assets/js/runtime~app.19128f21.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-123dff2c.47243fa1.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-3706649a.6536ff4d.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-384da568.667de1bc.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-44439230.8b89f9cb.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-548f4cfe.61f40391.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-6be4efb0.ec3640c3.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-77faca8c.ee876cd7.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-7900994c.059cfff8.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-7d5b94d0.b90251d7.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-8daa1a0e.eced6c93.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-d11cd4e0.ca9b65ee.js +0 -1
- package/docs/.vuepress/dist/custom-tabbar.html +0 -105
- package/docs/.vuepress/dist/deeplink.html +0 -69
- package/docs/.vuepress/dist/index.html +0 -44
- package/docs/.vuepress/dist/integration-native.html +0 -258
- package/docs/.vuepress/dist/integration-react.html +0 -109
- package/docs/.vuepress/dist/lifecycle.html +0 -74
- package/docs/.vuepress/dist/navigation.html +0 -208
- package/docs/.vuepress/dist/pass-and-return-value.html +0 -74
- package/docs/.vuepress/dist/qa.html +0 -31
- package/docs/.vuepress/dist/style.html +0 -306
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en-US">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<meta name="generator" content="VuePress 2.0.0-beta.26">
|
|
7
|
-
<title>自定义 TabBar | Hybrid Navigation</title><meta name="description" content="hybrid-navitation 文档">
|
|
8
|
-
<link rel="preload" href="/rn/hybrid-navigation/assets/js/runtime~app.19128f21.js" as="script"><link rel="preload" href="/rn/hybrid-navigation/assets/css/styles.701e6109.css" as="style"><link rel="preload" href="/rn/hybrid-navigation/assets/js/812.0c9a2f53.js" as="script"><link rel="preload" href="/rn/hybrid-navigation/assets/js/app.a66f731a.js" as="script">
|
|
9
|
-
<link rel="stylesheet" href="/rn/hybrid-navigation/assets/css/styles.701e6109.css">
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/rn/hybrid-navigation/" class=""><!----><span class="site-name">Hybrid Navigation</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/" target="_self" aria-label="首页"><!--[--><!--]--> 首页 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/rn/" target="_self" aria-label="React Native 指南"><!--[--><!--]--> React Native 指南 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="arrow down"></span></button><button class="mobile-dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="right arrow"></span></button><!--[--><ul style="display:none;" class="nav-dropdown"><!--[--><li class="dropdown-item"><a href="/rn/hybrid-navigation/" class="nav-link" aria-label="Hybrid Navigation"><!--[--><!--]--> Hybrid Navigation <!--[--><!--]--></a></li><li class="dropdown-item"><a class="nav-link external" href="https://todoit.tech/rn/devops/" target="_self" aria-label="React Native 工程实践"><!--[--><!--]--> React Native 工程实践 <!----><!--[--><!--]--></a></li><!--]--></ul><!--]--></div></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/listenzz" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/" target="_self" aria-label="首页"><!--[--><!--]--> 首页 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/rn/" target="_self" aria-label="React Native 指南"><!--[--><!--]--> React Native 指南 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="arrow down"></span></button><button class="mobile-dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="right arrow"></span></button><!--[--><ul style="display:none;" class="nav-dropdown"><!--[--><li class="dropdown-item"><a href="/rn/hybrid-navigation/" class="nav-link" aria-label="Hybrid Navigation"><!--[--><!--]--> Hybrid Navigation <!--[--><!--]--></a></li><li class="dropdown-item"><a class="nav-link external" href="https://todoit.tech/rn/devops/" target="_self" aria-label="React Native 工程实践"><!--[--><!--]--> React Native 工程实践 <!----><!--[--><!--]--></a></li><!--]--></ul><!--]--></div></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/listenzz" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-links"><!--[--><!--[--><a href="/rn/hybrid-navigation/integration-react.html" class="nav-link sidebar-heading sidebar-item" aria-label="集成到以 RN 为主的项目"><!--[--><!--]--> 集成到以 RN 为主的项目 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/integration-native.html" class="nav-link sidebar-heading sidebar-item" aria-label="为原生项目添加 RN 模块"><!--[--><!--]--> 为原生项目添加 RN 模块 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/navigation.html" class="nav-link sidebar-heading sidebar-item" aria-label="容器与导航"><!--[--><!--]--> 容器与导航 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/style.html" class="nav-link sidebar-heading sidebar-item" aria-label="样式和主题"><!--[--><!--]--> 样式和主题 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/pass-and-return-value.html" class="nav-link sidebar-heading sidebar-item" aria-label="RN 页面与原生页面相互跳转和传值"><!--[--><!--]--> RN 页面与原生页面相互跳转和传值 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/lifecycle.html" class="nav-link sidebar-heading sidebar-item" aria-label="可见性监听"><!--[--><!--]--> 可见性监听 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/deeplink.html" class="nav-link sidebar-heading sidebar-item" aria-label="DeepLink"><!--[--><!--]--> DeepLink <!--[--><!--]--></a><!----><!--]--><!--[--><a aria-current="page" href="/rn/hybrid-navigation/custom-tabbar.html" class="router-link-active router-link-exact-active nav-link router-link-active sidebar-heading sidebar-item active" aria-label="自定义 TabBar"><!--[--><!--]--> 自定义 TabBar <!--[--><!--]--></a><ul class=""><li><!--[--><a aria-current="page" href="/rn/hybrid-navigation/custom-tabbar.html#tabbar-组件和普通页面组件一样-需要注册" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="TabBar 组件和普通页面组件一样,需要注册:"><!--[--><!--]--> TabBar 组件和普通页面组件一样,需要注册: <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/rn/hybrid-navigation/custom-tabbar.html#在布局对象中-通过-tabbarmodulename-指定-tabbar-组件" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="在布局对象中,通过 tabBarModuleName 指定 TabBar 组件"><!--[--><!--]--> 在布局对象中,通过 tabBarModuleName 指定 TabBar 组件 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/rn/hybrid-navigation/custom-tabbar.html#通过-props-来获取相关数据" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="通过 props 来获取相关数据"><!--[--><!--]--> 通过 props 来获取相关数据 <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--[--><a href="/rn/hybrid-navigation/qa.html" class="nav-link sidebar-heading sidebar-item" aria-label="常见问题"><!--[--><!--]--> 常见问题 <!--[--><!--]--></a><!----><!--]--><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="自定义-tabbar" tabindex="-1"><a class="header-anchor" href="#自定义-tabbar" aria-hidden="true">#</a> 自定义 TabBar</h1><p>tabs 容器有一个默认的 TabBar, 支持未读消息数,小红点提示等功能。它是由原生组件实现的,性能优越,满足 80% 常用场景。如果你希望对 TabBar 有更多的控制权,譬如实现如下效果:</p><p><img src="/rn/hybrid-navigation/assets/img/tabbar.73212e13.jpg" alt=""></p><p>那么你需要使用 <code>tabBarModuleName</code> 选项来指定你的 TabBar 组件。</p><p>左图效果的实现,请参看 example/src/CustomTabBar.js,右图效果的实现,请参看 example/src/BulgeTabBar.js。</p><p>此外,需要注意以下若干事项:</p><h2 id="tabbar-组件和普通页面组件一样-需要注册" tabindex="-1"><a class="header-anchor" href="#tabbar-组件和普通页面组件一样-需要注册" aria-hidden="true">#</a> TabBar 组件和普通页面组件一样,需要注册:</h2><div class="language-javascript ext-js"><pre class="language-javascript"><code><span class="token keyword">import</span> CustomTabBar <span class="token keyword">from</span> <span class="token string">'./src/CustomTabBar'</span>
|
|
13
|
-
<span class="token keyword">import</span> BulgeTabBar <span class="token keyword">from</span> <span class="token string">'./src/BulgeTabBar'</span>
|
|
14
|
-
|
|
15
|
-
ReactRegistry<span class="token punctuation">.</span><span class="token function">registerComponent</span><span class="token punctuation">(</span><span class="token string">'CustomTabBar'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> CustomTabBar<span class="token punctuation">)</span>
|
|
16
|
-
ReactRegistry<span class="token punctuation">.</span><span class="token function">registerComponent</span><span class="token punctuation">(</span><span class="token string">'BulgeTabBar'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> BulgeTabBar<span class="token punctuation">)</span>
|
|
17
|
-
</code></pre></div><h2 id="在布局对象中-通过-tabbarmodulename-指定-tabbar-组件" tabindex="-1"><a class="header-anchor" href="#在布局对象中-通过-tabbarmodulename-指定-tabbar-组件" aria-hidden="true">#</a> 在布局对象中,通过 <code>tabBarModuleName</code> 指定 TabBar 组件</h2><p>如果<strong>不需要</strong>中间按钮凸起效果,<code>sizeIndeterminate</code> 需要设置为 <code>false</code>,同时指定 TabBar 的宽高。</p><div class="language-javascript ext-js"><pre class="language-javascript"><code>Navigator<span class="token punctuation">.</span><span class="token function">setRoot</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
|
|
18
|
-
tabs<span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
19
|
-
children<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
|
|
20
|
-
options<span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
21
|
-
tabBarModuleName<span class="token operator">:</span> <span class="token string">'CustomTabBar'</span><span class="token punctuation">,</span>
|
|
22
|
-
sizeIndeterminate<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
|
23
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
24
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
25
|
-
<span class="token punctuation">}</span><span class="token punctuation">)</span>
|
|
26
|
-
</code></pre></div><div class="language-javascript ext-js"><pre class="language-javascript"><code>tabBar<span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
27
|
-
<span class="token comment">// 56 和 48 是原生 TabBar 容器的实际高度,是固定值。</span>
|
|
28
|
-
height<span class="token operator">:</span> Platform<span class="token punctuation">.</span><span class="token constant">OS</span> <span class="token operator">===</span> <span class="token string">'android'</span> <span class="token operator">?</span> <span class="token number">56</span> <span class="token operator">:</span> <span class="token number">48</span><span class="token punctuation">,</span>
|
|
29
|
-
width<span class="token operator">:</span> Dimensions<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">'window'</span><span class="token punctuation">)</span><span class="token punctuation">.</span>width<span class="token punctuation">,</span>
|
|
30
|
-
flexDirection<span class="token operator">:</span> <span class="token string">'row'</span><span class="token punctuation">,</span>
|
|
31
|
-
justifyContent<span class="token operator">:</span> <span class="token string">'center'</span><span class="token punctuation">,</span>
|
|
32
|
-
alignItems<span class="token operator">:</span> <span class="token string">'stretch'</span><span class="token punctuation">,</span>
|
|
33
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
34
|
-
</code></pre></div><p>如果<strong>需要</strong>实现中间按钮凸起效果,<code>sizeIndeterminate</code> 需要设置为 <code>true</code>,同时指定 TabBar 期待的(包含凸起按钮后的)宽高,以及 TabBar 的实际宽高。</p><div class="language-javascript ext-js"><pre class="language-javascript"><code>Navigator<span class="token punctuation">.</span><span class="token function">setRoot</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
|
|
35
|
-
tabs<span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
36
|
-
children<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
|
|
37
|
-
options<span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
38
|
-
tabBarModuleName<span class="token operator">:</span> <span class="token string">'BulgeTabBar'</span><span class="token punctuation">,</span>
|
|
39
|
-
sizeIndeterminate<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
|
40
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
41
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
42
|
-
<span class="token punctuation">}</span><span class="token punctuation">)</span>
|
|
43
|
-
</code></pre></div><div class="language-javascript ext-js"><pre class="language-javascript"><code>container<span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
44
|
-
<span class="token comment">// TabBar 期待的宽高</span>
|
|
45
|
-
height<span class="token operator">:</span> Platform<span class="token punctuation">.</span><span class="token constant">OS</span> <span class="token operator">===</span> <span class="token string">'android'</span> <span class="token operator">?</span> <span class="token number">78</span> <span class="token operator">:</span> <span class="token number">72</span><span class="token punctuation">,</span>
|
|
46
|
-
width<span class="token operator">:</span> Dimensions<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">'window'</span><span class="token punctuation">)</span><span class="token punctuation">.</span>width<span class="token punctuation">,</span>
|
|
47
|
-
justifyContent<span class="token operator">:</span> <span class="token string">'flex-start'</span><span class="token punctuation">,</span>
|
|
48
|
-
alignItems<span class="token operator">:</span> <span class="token string">'center'</span><span class="token punctuation">,</span>
|
|
49
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
50
|
-
bulge<span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
51
|
-
justifyContent<span class="token operator">:</span> <span class="token string">'center'</span><span class="token punctuation">,</span>
|
|
52
|
-
alignItems<span class="token operator">:</span> <span class="token string">'center'</span><span class="token punctuation">,</span>
|
|
53
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
54
|
-
<span class="token comment">// TabBar 的实际宽高以及相对于父组件的位置</span>
|
|
55
|
-
tabBar<span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
56
|
-
<span class="token comment">// TabBar 原生底层容器的高度,这个高度是固定的。</span>
|
|
57
|
-
height<span class="token operator">:</span> Platform<span class="token punctuation">.</span><span class="token constant">OS</span> <span class="token operator">===</span> <span class="token string">'android'</span> <span class="token operator">?</span> <span class="token number">56</span> <span class="token operator">:</span> <span class="token number">48</span><span class="token punctuation">,</span>
|
|
58
|
-
position<span class="token operator">:</span> <span class="token string">'absolute'</span><span class="token punctuation">,</span>
|
|
59
|
-
bottom<span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
|
|
60
|
-
left<span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
|
|
61
|
-
right<span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
|
|
62
|
-
flexDirection<span class="token operator">:</span> <span class="token string">'row'</span><span class="token punctuation">,</span>
|
|
63
|
-
justifyContent<span class="token operator">:</span> <span class="token string">'center'</span><span class="token punctuation">,</span>
|
|
64
|
-
alignItems<span class="token operator">:</span> <span class="token string">'stretch'</span><span class="token punctuation">,</span>
|
|
65
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
66
|
-
</code></pre></div><h2 id="通过-props-来获取相关数据" tabindex="-1"><a class="header-anchor" href="#通过-props-来获取相关数据" aria-hidden="true">#</a> 通过 props 来获取相关数据</h2><p>可以通过 props.selectedIndex 来获取当前选中的 tab 的索引。props 还有许多有用的信息,它的数据结构如下:</p><div class="language-json ext-json"><pre class="language-json"><code><span class="token punctuation">{</span>
|
|
67
|
-
<span class="token property">"sceneId"</span><span class="token operator">:</span> <span class="token string">"82a466fb-4a33-452d-b53e-d5122bf93078"</span><span class="token punctuation">,</span>
|
|
68
|
-
<span class="token property">"moduleName"</span><span class="token operator">:</span> <span class="token string">"CustomTabBar"</span><span class="token punctuation">,</span>
|
|
69
|
-
<span class="token property">"navigator"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
70
|
-
<span class="token property">"sceneId"</span><span class="token operator">:</span> <span class="token string">"82a466fb-4a33-452d-b53e-d5122bf93078"</span><span class="token punctuation">,</span>
|
|
71
|
-
<span class="token property">"moduleName"</span><span class="token operator">:</span> <span class="token string">"CustomTabBar"</span>
|
|
72
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
73
|
-
<span class="token property">"garden"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
74
|
-
<span class="token property">"sceneId"</span><span class="token operator">:</span> <span class="token string">"82a466fb-4a33-452d-b53e-d5122bf93078"</span>
|
|
75
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
76
|
-
<span class="token property">"selectedIndex"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
|
|
77
|
-
<span class="token property">"itemColor"</span><span class="token operator">:</span> <span class="token string">"#8BC34A"</span><span class="token punctuation">,</span>
|
|
78
|
-
<span class="token property">"unselectedItemColor"</span><span class="token operator">:</span> <span class="token string">"#BDBDBD"</span><span class="token punctuation">,</span>
|
|
79
|
-
<span class="token property">"badgeColor"</span><span class="token operator">:</span> <span class="token string">"#FF3B30"</span><span class="token punctuation">,</span>
|
|
80
|
-
<span class="token property">"tabs"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
|
|
81
|
-
<span class="token punctuation">{</span>
|
|
82
|
-
<span class="token property">"index"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
|
|
83
|
-
<span class="token property">"sceneId"</span><span class="token operator">:</span> <span class="token string">"86195762-DB47-4354-AE62-753D308818BC"</span><span class="token punctuation">,</span>
|
|
84
|
-
<span class="token property">"moduleName"</span><span class="token operator">:</span> <span class="token string">"Navigation"</span><span class="token punctuation">,</span>
|
|
85
|
-
<span class="token property">"title"</span><span class="token operator">:</span> <span class="token string">"Navigation"</span><span class="token punctuation">,</span>
|
|
86
|
-
<span class="token property">"dot"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
|
87
|
-
<span class="token property">"icon"</span><span class="token operator">:</span> <span class="token string">"font://FontAwesome//24/#FFFFFF"</span><span class="token punctuation">,</span>
|
|
88
|
-
<span class="token property">"unselectedIcon"</span><span class="token operator">:</span> <span class="token null keyword">null</span>
|
|
89
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
90
|
-
<span class="token punctuation">{</span>
|
|
91
|
-
<span class="token property">"index"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
|
|
92
|
-
<span class="token property">"sceneId"</span><span class="token operator">:</span> <span class="token string">"F28EB922-FDC3-426F-B572-F1E90EFC47F8"</span><span class="token punctuation">,</span>
|
|
93
|
-
<span class="token property">"moduleName"</span><span class="token operator">:</span> <span class="token string">"Options"</span><span class="token punctuation">,</span>
|
|
94
|
-
<span class="token property">"title"</span><span class="token operator">:</span> <span class="token string">"Options"</span><span class="token punctuation">,</span>
|
|
95
|
-
<span class="token property">"badgeText"</span><span class="token operator">:</span> <span class="token string">"99"</span><span class="token punctuation">,</span>
|
|
96
|
-
<span class="token property">"icon"</span><span class="token operator">:</span> <span class="token string">"flower"</span><span class="token punctuation">,</span>
|
|
97
|
-
<span class="token property">"unselectedIcon"</span><span class="token operator">:</span> <span class="token null keyword">null</span>
|
|
98
|
-
<span class="token punctuation">}</span>
|
|
99
|
-
<span class="token punctuation">]</span>
|
|
100
|
-
<span class="token punctuation">}</span>
|
|
101
|
-
</code></pre></div><p>其中 sceneId 是 tabs 容器的 sceneId,navigator 是 tabs 容器的 navigator,如果你希望获取某个 tab 页面的 navigator,可以通过如下方式:</p><div class="language-javascript ext-js"><pre class="language-javascript"><code><span class="token keyword">const</span> navigator <span class="token operator">=</span> Navigator<span class="token punctuation">.</span><span class="token function">of</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>props<span class="token punctuation">.</span>tabs<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>sceneId<span class="token punctuation">)</span>
|
|
102
|
-
</code></pre></div><blockquote><p>TabBar 的背景颜色,分割线,仍然由原生控制。</p></blockquote><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">上次更新: </span><span class="meta-item-info">10/11/2021, 2:02:30 PM</span></div><!----></footer><nav class="page-nav"><p class="inner"><span class="prev"> ← <a href="/rn/hybrid-navigation/deeplink.html" class="nav-link" aria-label="DeepLink"><!--[--><!--]--> DeepLink <!--[--><!--]--></a></span><span class="next"><a href="/rn/hybrid-navigation/qa.html" class="nav-link" aria-label="常见问题"><!--[--><!--]--> 常见问题 <!--[--><!--]--></a> → </span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
|
|
103
|
-
<script src="/rn/hybrid-navigation/assets/js/runtime~app.19128f21.js" defer></script><script src="/rn/hybrid-navigation/assets/js/812.0c9a2f53.js" defer></script><script src="/rn/hybrid-navigation/assets/js/app.a66f731a.js" defer></script>
|
|
104
|
-
</body>
|
|
105
|
-
</html>
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en-US">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<meta name="generator" content="VuePress 2.0.0-beta.26">
|
|
7
|
-
<title>DeepLink | Hybrid Navigation</title><meta name="description" content="hybrid-navitation 文档">
|
|
8
|
-
<link rel="preload" href="/rn/hybrid-navigation/assets/js/runtime~app.19128f21.js" as="script"><link rel="preload" href="/rn/hybrid-navigation/assets/css/styles.701e6109.css" as="style"><link rel="preload" href="/rn/hybrid-navigation/assets/js/812.0c9a2f53.js" as="script"><link rel="preload" href="/rn/hybrid-navigation/assets/js/app.a66f731a.js" as="script">
|
|
9
|
-
<link rel="stylesheet" href="/rn/hybrid-navigation/assets/css/styles.701e6109.css">
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/rn/hybrid-navigation/" class=""><!----><span class="site-name">Hybrid Navigation</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/" target="_self" aria-label="首页"><!--[--><!--]--> 首页 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/rn/" target="_self" aria-label="React Native 指南"><!--[--><!--]--> React Native 指南 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="arrow down"></span></button><button class="mobile-dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="right arrow"></span></button><!--[--><ul style="display:none;" class="nav-dropdown"><!--[--><li class="dropdown-item"><a href="/rn/hybrid-navigation/" class="nav-link" aria-label="Hybrid Navigation"><!--[--><!--]--> Hybrid Navigation <!--[--><!--]--></a></li><li class="dropdown-item"><a class="nav-link external" href="https://todoit.tech/rn/devops/" target="_self" aria-label="React Native 工程实践"><!--[--><!--]--> React Native 工程实践 <!----><!--[--><!--]--></a></li><!--]--></ul><!--]--></div></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/listenzz" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/" target="_self" aria-label="首页"><!--[--><!--]--> 首页 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/rn/" target="_self" aria-label="React Native 指南"><!--[--><!--]--> React Native 指南 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="arrow down"></span></button><button class="mobile-dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="right arrow"></span></button><!--[--><ul style="display:none;" class="nav-dropdown"><!--[--><li class="dropdown-item"><a href="/rn/hybrid-navigation/" class="nav-link" aria-label="Hybrid Navigation"><!--[--><!--]--> Hybrid Navigation <!--[--><!--]--></a></li><li class="dropdown-item"><a class="nav-link external" href="https://todoit.tech/rn/devops/" target="_self" aria-label="React Native 工程实践"><!--[--><!--]--> React Native 工程实践 <!----><!--[--><!--]--></a></li><!--]--></ul><!--]--></div></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/listenzz" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-links"><!--[--><!--[--><a href="/rn/hybrid-navigation/integration-react.html" class="nav-link sidebar-heading sidebar-item" aria-label="集成到以 RN 为主的项目"><!--[--><!--]--> 集成到以 RN 为主的项目 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/integration-native.html" class="nav-link sidebar-heading sidebar-item" aria-label="为原生项目添加 RN 模块"><!--[--><!--]--> 为原生项目添加 RN 模块 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/navigation.html" class="nav-link sidebar-heading sidebar-item" aria-label="容器与导航"><!--[--><!--]--> 容器与导航 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/style.html" class="nav-link sidebar-heading sidebar-item" aria-label="样式和主题"><!--[--><!--]--> 样式和主题 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/pass-and-return-value.html" class="nav-link sidebar-heading sidebar-item" aria-label="RN 页面与原生页面相互跳转和传值"><!--[--><!--]--> RN 页面与原生页面相互跳转和传值 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/lifecycle.html" class="nav-link sidebar-heading sidebar-item" aria-label="可见性监听"><!--[--><!--]--> 可见性监听 <!--[--><!--]--></a><!----><!--]--><!--[--><a aria-current="page" href="/rn/hybrid-navigation/deeplink.html" class="router-link-active router-link-exact-active nav-link router-link-active sidebar-heading sidebar-item active" aria-label="DeepLink"><!--[--><!--]--> DeepLink <!--[--><!--]--></a><ul class=""><li><!--[--><a aria-current="page" href="/rn/hybrid-navigation/deeplink.html#注册" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="注册"><!--[--><!--]--> 注册 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/rn/hybrid-navigation/deeplink.html#激活" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="激活"><!--[--><!--]--> 激活 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/rn/hybrid-navigation/deeplink.html#拦截" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="拦截"><!--[--><!--]--> 拦截 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/rn/hybrid-navigation/deeplink.html#ios-配置" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="iOS 配置"><!--[--><!--]--> iOS 配置 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/rn/hybrid-navigation/deeplink.html#android-配置" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Android 配置"><!--[--><!--]--> Android 配置 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/rn/hybrid-navigation/deeplink.html#测试" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="测试"><!--[--><!--]--> 测试 <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--[--><a href="/rn/hybrid-navigation/custom-tabbar.html" class="nav-link sidebar-heading sidebar-item" aria-label="自定义 TabBar"><!--[--><!--]--> 自定义 TabBar <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/qa.html" class="nav-link sidebar-heading sidebar-item" aria-label="常见问题"><!--[--><!--]--> 常见问题 <!--[--><!--]--></a><!----><!--]--><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="deeplink" tabindex="-1"><a class="header-anchor" href="#deeplink" aria-hidden="true">#</a> DeepLink</h1><p>0.5.0 版本开始支持 DeepLink.</p><h2 id="注册" tabindex="-1"><a class="header-anchor" href="#注册" aria-hidden="true">#</a> 注册</h2><p><a name="router-config"></a></p><p>需要支持 DeepLink 的页面,在注册时需要传入第三个参数</p><div class="language-javascript ext-js"><pre class="language-javascript"><code>ReactRegistry<span class="token punctuation">.</span><span class="token function">registerComponent</span><span class="token punctuation">(</span><span class="token string">'TopBarStyle'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> TopBarStyle<span class="token punctuation">,</span> <span class="token punctuation">{</span>
|
|
13
|
-
path<span class="token operator">:</span> <span class="token string">'/topBarStyle/:who'</span><span class="token punctuation">,</span>
|
|
14
|
-
dependency<span class="token operator">:</span> <span class="token string">'TopBarMisc'</span><span class="token punctuation">,</span>
|
|
15
|
-
<span class="token punctuation">}</span><span class="token punctuation">)</span>
|
|
16
|
-
</code></pre></div><p>这个参数是个对象,一共有三个可选项</p><p>path 表示路径,其中冒号开头的片段表示参数,这些参数将会通过 props 传递给目标页面。</p><p>dependency 表示前置页面,譬如一个详情页可能会依赖一个列表页,当点击返回按钮时,会回到列表页。这个选项可以确定依赖链。看 example 中的例子:</p><div class="language-javascript ext-js"><pre class="language-javascript"><code>ReactRegistry<span class="token punctuation">.</span><span class="token function">registerComponent</span><span class="token punctuation">(</span><span class="token string">'Options'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> Options<span class="token punctuation">)</span>
|
|
17
|
-
ReactRegistry<span class="token punctuation">.</span><span class="token function">registerComponent</span><span class="token punctuation">(</span><span class="token string">'TopBarMisc'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> TopBarMisc<span class="token punctuation">,</span> <span class="token punctuation">{</span> dependency<span class="token operator">:</span> <span class="token string">'Options'</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
|
|
18
|
-
ReactRegistry<span class="token punctuation">.</span><span class="token function">registerComponent</span><span class="token punctuation">(</span><span class="token string">'TopBarStyle'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> TopBarStyle<span class="token punctuation">,</span> <span class="token punctuation">{</span>
|
|
19
|
-
path<span class="token operator">:</span> <span class="token string">'/topBarStyle/:who'</span><span class="token punctuation">,</span>
|
|
20
|
-
dependency<span class="token operator">:</span> <span class="token string">'TopBarMisc'</span><span class="token punctuation">,</span>
|
|
21
|
-
<span class="token punctuation">}</span><span class="token punctuation">)</span>
|
|
22
|
-
</code></pre></div><p>TopBarStyle 依赖 TopBarMisc, TopBarMisc 依赖 Options, 当我们通过 <code>hbd://topBarStyle/xxxx?greeting=yyyy</code> 这样的 url 打开 TopBarStyle 这个页面时,会检查 app 当前的路由图,以决定是否切换到 tab Options, 在打开 TopBarStyle 之前是否需要创建 TopBarMisc。</p><p>mode 表示跳转模式,present 表示使用 <code>navigator.present</code> 打开目标页面, <code>modal</code> 表示使用 <code>navigator.showModal</code> 打开页面,默认是通过 push 的方式打开。</p><blockquote><p>0.23.0 开始支持 queryString,queryString 不能注册在 path 中</p></blockquote><h2 id="激活" tabindex="-1"><a class="header-anchor" href="#激活" aria-hidden="true">#</a> 激活</h2><p>我们需要在一个稳定的页面(通常是主页面)激活 DeepLink 功能。</p><p>譬如 example 项目,在 Navigation.js 激活了路由功能</p><div class="language-javascript ext-js"><pre class="language-javascript"><code><span class="token keyword">import</span> <span class="token punctuation">{</span> DeepLink <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'hybrid-navigation'</span><span class="token punctuation">;</span>
|
|
23
|
-
|
|
24
|
-
<span class="token function">componentDidMount</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
|
25
|
-
<span class="token keyword">const</span> prefix <span class="token operator">=</span> <span class="token string">'hbd://'</span><span class="token punctuation">;</span>
|
|
26
|
-
DeepLink<span class="token punctuation">.</span><span class="token function">activate</span><span class="token punctuation">(</span>prefix<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
|
27
|
-
<span class="token punctuation">}</span>
|
|
28
|
-
|
|
29
|
-
<span class="token function">componentWillUnmount</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
|
30
|
-
DeepLink<span class="token punctuation">.</span><span class="token function">deactivate</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
|
31
|
-
<span class="token punctuation">}</span>
|
|
32
|
-
</code></pre></div><p>也可以通过以下方式激活</p><div class="language-javascript ext-js"><pre class="language-javascript"><code><span class="token comment">// 激活 DeepLink,在 Navigator.setRoot 之前</span>
|
|
33
|
-
Navigator<span class="token punctuation">.</span><span class="token function">setRootLayoutUpdateListener</span><span class="token punctuation">(</span>
|
|
34
|
-
<span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
|
|
35
|
-
DeepLink<span class="token punctuation">.</span><span class="token function">deactivate</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
|
36
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
37
|
-
<span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
|
|
38
|
-
<span class="token keyword">const</span> prefix <span class="token operator">=</span> <span class="token string">'hbd://'</span>
|
|
39
|
-
DeepLink<span class="token punctuation">.</span><span class="token function">activate</span><span class="token punctuation">(</span>prefix<span class="token punctuation">)</span>
|
|
40
|
-
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
|
41
|
-
<span class="token punctuation">)</span>
|
|
42
|
-
|
|
43
|
-
<span class="token comment">// 设置 UI 层级</span>
|
|
44
|
-
Navigator<span class="token punctuation">.</span><span class="token function">setRoot</span><span class="token punctuation">(</span>drawer<span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">)</span>
|
|
45
|
-
</code></pre></div><h2 id="拦截" tabindex="-1"><a class="header-anchor" href="#拦截" aria-hidden="true">#</a> 拦截</h2><p>有时我们需要拦截默认的跳转行为</p><p>router 对象为我们提供了注册和移除拦截器的一对方法</p><div class="language-javascript ext-js"><pre class="language-javascript"><code><span class="token keyword">import</span> <span class="token punctuation">{</span> router <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'hybrid-navigation'</span>
|
|
46
|
-
router<span class="token punctuation">.</span><span class="token function">addInterceptor</span><span class="token punctuation">(</span>func<span class="token punctuation">)</span>
|
|
47
|
-
router<span class="token punctuation">.</span><span class="token function">removeInterceptor</span><span class="token punctuation">(</span>func<span class="token punctuation">)</span>
|
|
48
|
-
</code></pre></div><p>func 是一个接收 path 为参数,返回 boolen 的函数,返回 true 表示拦截。</p><p>可以通过 <code>router.pathToRoute(path)</code> 来获取路由信息</p><h2 id="ios-配置" tabindex="-1"><a class="header-anchor" href="#ios-配置" aria-hidden="true">#</a> iOS 配置</h2><p>Let's configure the native iOS app to open based on the mychat:// URI scheme.</p><p>In SimpleApp/ios/SimpleApp/AppDelegate.m:</p><div class="language-objc ext-objc"><pre class="language-objc"><code><span class="token comment">// Add the header at the top of the file:</span>
|
|
49
|
-
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">import</span> <span class="token expression"><span class="token operator"><</span>React<span class="token operator">/</span>RCTLinkingManager<span class="token punctuation">.</span>h<span class="token operator">></span></span></span>
|
|
50
|
-
|
|
51
|
-
<span class="token comment">// Add this above the `@end`:</span>
|
|
52
|
-
<span class="token operator">-</span> <span class="token punctuation">(</span>BOOL<span class="token punctuation">)</span>application<span class="token punctuation">:</span><span class="token punctuation">(</span>UIApplication <span class="token operator">*</span><span class="token punctuation">)</span>application openURL<span class="token punctuation">:</span><span class="token punctuation">(</span>NSURL <span class="token operator">*</span><span class="token punctuation">)</span>url
|
|
53
|
-
sourceApplication<span class="token punctuation">:</span><span class="token punctuation">(</span>NSString <span class="token operator">*</span><span class="token punctuation">)</span>sourceApplication annotation<span class="token punctuation">:</span><span class="token punctuation">(</span>id<span class="token punctuation">)</span>annotation
|
|
54
|
-
<span class="token punctuation">{</span>
|
|
55
|
-
<span class="token keyword">return</span> <span class="token punctuation">[</span>RCTLinkingManager application<span class="token punctuation">:</span>application openURL<span class="token punctuation">:</span>url
|
|
56
|
-
sourceApplication<span class="token punctuation">:</span>sourceApplication annotation<span class="token punctuation">:</span>annotation<span class="token punctuation">]</span><span class="token punctuation">;</span>
|
|
57
|
-
<span class="token punctuation">}</span>
|
|
58
|
-
</code></pre></div><p>In Xcode, open the project at SimpleApp/ios/SimpleApp.xcodeproj. Select the project in sidebar and navigate to the info tab. Scroll down to "URL Types" and add one. In the new URL type, set the identifier and the url scheme to your desired url scheme.</p><p><img src="/rn/hybrid-navigation/assets/img/xcode-linking.685ce6ea.png" alt="xcode-linking"></p><h2 id="android-配置" tabindex="-1"><a class="header-anchor" href="#android-配置" aria-hidden="true">#</a> Android 配置</h2><p>To configure the external linking in Android, you can create a new intent in the manifest.</p><p>In SimpleApp/android/app/src/main/AndroidManifest.xml, add the new intent-filter inside the MainActivity entry with a VIEW type action:</p><div class="language-xml ext-xml"><pre class="language-xml"><code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>intent-filter</span><span class="token punctuation">></span></span>
|
|
59
|
-
<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>action</span> <span class="token attr-name"><span class="token namespace">android:</span>name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>android.intent.action.VIEW<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>
|
|
60
|
-
<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>category</span> <span class="token attr-name"><span class="token namespace">android:</span>name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>android.intent.category.DEFAULT<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>
|
|
61
|
-
<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>category</span> <span class="token attr-name"><span class="token namespace">android:</span>name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>android.intent.category.BROWSABLE<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>
|
|
62
|
-
<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>data</span> <span class="token attr-name"><span class="token namespace">android:</span>scheme</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>mychat<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>
|
|
63
|
-
<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>intent-filter</span><span class="token punctuation">></span></span>
|
|
64
|
-
</code></pre></div><blockquote><p>MainActivity 的 launchMode 需要设置为 singleTask</p></blockquote><h2 id="测试" tabindex="-1"><a class="header-anchor" href="#测试" aria-hidden="true">#</a> 测试</h2><p>具体可以参考 example 这个项目中相关配置</p><p>可以在终端中通过以下两个命令分别测试 iOS 和 Android 的效果</p><p>iOS:</p><div class="language-text ext-text"><pre class="language-text"><code>xcrun simctl openurl booted "hbd://topBarStyle/xxxx?greeting=yyyy"
|
|
65
|
-
</code></pre></div><p>Android:</p><div class="language-text ext-text"><pre class="language-text"><code>adb shell am start -W -a android.intent.action.VIEW -d "hbd://topBarStyle/xxxx?greeting=yyyy"
|
|
66
|
-
</code></pre></div><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">上次更新: </span><span class="meta-item-info">10/11/2021, 2:02:30 PM</span></div><!----></footer><nav class="page-nav"><p class="inner"><span class="prev"> ← <a href="/rn/hybrid-navigation/lifecycle.html" class="nav-link" aria-label="可见性监听"><!--[--><!--]--> 可见性监听 <!--[--><!--]--></a></span><span class="next"><a href="/rn/hybrid-navigation/custom-tabbar.html" class="nav-link" aria-label="自定义 TabBar"><!--[--><!--]--> 自定义 TabBar <!--[--><!--]--></a> → </span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
|
|
67
|
-
<script src="/rn/hybrid-navigation/assets/js/runtime~app.19128f21.js" defer></script><script src="/rn/hybrid-navigation/assets/js/812.0c9a2f53.js" defer></script><script src="/rn/hybrid-navigation/assets/js/app.a66f731a.js" defer></script>
|
|
68
|
-
</body>
|
|
69
|
-
</html>
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en-US">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<meta name="generator" content="VuePress 2.0.0-beta.26">
|
|
7
|
-
<title>Hybrid Navigation | Hybrid Navigation</title><meta name="description" content="hybrid-navitation 文档">
|
|
8
|
-
<link rel="preload" href="/rn/hybrid-navigation/assets/js/runtime~app.19128f21.js" as="script"><link rel="preload" href="/rn/hybrid-navigation/assets/css/styles.701e6109.css" as="style"><link rel="preload" href="/rn/hybrid-navigation/assets/js/812.0c9a2f53.js" as="script"><link rel="preload" href="/rn/hybrid-navigation/assets/js/app.a66f731a.js" as="script">
|
|
9
|
-
<link rel="stylesheet" href="/rn/hybrid-navigation/assets/css/styles.701e6109.css">
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a aria-current="page" href="/rn/hybrid-navigation/" class="router-link-active router-link-exact-active"><!----><span class="site-name">Hybrid Navigation</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/" target="_self" aria-label="首页"><!--[--><!--]--> 首页 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/rn/" target="_self" aria-label="React Native 指南"><!--[--><!--]--> React Native 指南 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="arrow down"></span></button><button class="mobile-dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="right arrow"></span></button><!--[--><ul style="display:none;" class="nav-dropdown"><!--[--><li class="dropdown-item"><a aria-current="page" href="/rn/hybrid-navigation/" class="router-link-active router-link-exact-active nav-link" aria-label="Hybrid Navigation"><!--[--><!--]--> Hybrid Navigation <!--[--><!--]--></a></li><li class="dropdown-item"><a class="nav-link external" href="https://todoit.tech/rn/devops/" target="_self" aria-label="React Native 工程实践"><!--[--><!--]--> React Native 工程实践 <!----><!--[--><!--]--></a></li><!--]--></ul><!--]--></div></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/listenzz" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/" target="_self" aria-label="首页"><!--[--><!--]--> 首页 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://todoit.tech/rn/" target="_self" aria-label="React Native 指南"><!--[--><!--]--> React Native 指南 <!----><!--[--><!--]--></a></div><div class="navbar-links-item"><div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="arrow down"></span></button><button class="mobile-dropdown-title" type="button" aria-label="文档"><span class="title">文档</span><span class="right arrow"></span></button><!--[--><ul style="display:none;" class="nav-dropdown"><!--[--><li class="dropdown-item"><a aria-current="page" href="/rn/hybrid-navigation/" class="router-link-active router-link-exact-active nav-link" aria-label="Hybrid Navigation"><!--[--><!--]--> Hybrid Navigation <!--[--><!--]--></a></li><li class="dropdown-item"><a class="nav-link external" href="https://todoit.tech/rn/devops/" target="_self" aria-label="React Native 工程实践"><!--[--><!--]--> React Native 工程实践 <!----><!--[--><!--]--></a></li><!--]--></ul><!--]--></div></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/listenzz" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-links"><!--[--><!--[--><a href="/rn/hybrid-navigation/integration-react.html" class="nav-link sidebar-heading sidebar-item" aria-label="集成到以 RN 为主的项目"><!--[--><!--]--> 集成到以 RN 为主的项目 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/integration-native.html" class="nav-link sidebar-heading sidebar-item" aria-label="为原生项目添加 RN 模块"><!--[--><!--]--> 为原生项目添加 RN 模块 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/navigation.html" class="nav-link sidebar-heading sidebar-item" aria-label="容器与导航"><!--[--><!--]--> 容器与导航 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/style.html" class="nav-link sidebar-heading sidebar-item" aria-label="样式和主题"><!--[--><!--]--> 样式和主题 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/pass-and-return-value.html" class="nav-link sidebar-heading sidebar-item" aria-label="RN 页面与原生页面相互跳转和传值"><!--[--><!--]--> RN 页面与原生页面相互跳转和传值 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/lifecycle.html" class="nav-link sidebar-heading sidebar-item" aria-label="可见性监听"><!--[--><!--]--> 可见性监听 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/deeplink.html" class="nav-link sidebar-heading sidebar-item" aria-label="DeepLink"><!--[--><!--]--> DeepLink <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/custom-tabbar.html" class="nav-link sidebar-heading sidebar-item" aria-label="自定义 TabBar"><!--[--><!--]--> 自定义 TabBar <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/rn/hybrid-navigation/qa.html" class="nav-link sidebar-heading sidebar-item" aria-label="常见问题"><!--[--><!--]--> 常见问题 <!--[--><!--]--></a><!----><!--]--><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="hybrid-navigation" tabindex="-1"><a class="header-anchor" href="#hybrid-navigation" aria-hidden="true">#</a> Hybrid Navigation</h1><p><a href="https://github.com/listenzz/hybrid-navigation" target="_blank" rel="noopener noreferrer">Hybrid Navigation<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a>是一款 React Native 导航组件,支持在 react 页面和原生页面之间无缝导航。</p><h2 id="特性" tabindex="-1"><a class="header-anchor" href="#特性" aria-hidden="true">#</a> 特性</h2><ul><li>使用原生导航组件实现 React Native 页面间的导航,不仅具有更优的性能,而且使得 RN 页面具有原生质感</li><li>原生页面和 RN 页面共享路由, 使得它们之间相互跳转和传值轻而易举</li><li>内置 drawer, tabs, stack 标准容器,同时支持自定义容器和导航</li><li>支持 deep link</li></ul><p><img src="/rn/hybrid-navigation/assets/img/android.e350dcdd.png" alt="navigation-android"></p><h2 id="support" tabindex="-1"><a class="header-anchor" href="#support" aria-hidden="true">#</a> Support</h2><table><thead><tr><th>version</th><th>react-native version</th></tr></thead><tbody><tr><td>1.0.0+</td><td>0.60.0+</td></tr></tbody></table><p>如果你使用 1.5.0 以上版本,需要修改 android/build.gradle 文件,添加 mavenCentral()</p><div class="language-groovy ext-groovy"><pre class="language-groovy"><code>allprojects <span class="token punctuation">{</span>
|
|
13
|
-
repositories <span class="token punctuation">{</span>
|
|
14
|
-
<span class="token function">mavenLocal</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
|
15
|
-
maven <span class="token punctuation">{</span>
|
|
16
|
-
<span class="token comment">// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm</span>
|
|
17
|
-
<span class="token function">url</span><span class="token punctuation">(</span><span class="token string gstring">"<span class="token expression"><span class="token punctuation">$</span>rootDir</span>/../node_modules/react-native/android"</span><span class="token punctuation">)</span>
|
|
18
|
-
<span class="token punctuation">}</span>
|
|
19
|
-
maven <span class="token punctuation">{</span>
|
|
20
|
-
<span class="token comment">// Android JSC is installed from npm</span>
|
|
21
|
-
<span class="token function">url</span><span class="token punctuation">(</span><span class="token string gstring">"<span class="token expression"><span class="token punctuation">$</span>rootDir</span>/../node_modules/jsc-android/dist"</span><span class="token punctuation">)</span>
|
|
22
|
-
<span class="token punctuation">}</span>
|
|
23
|
-
<span class="token function">google</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
|
24
|
-
<span class="token function">jcenter</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
|
25
|
-
<span class="token function">mavenCentral</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
|
26
|
-
maven <span class="token punctuation">{</span> url <span class="token string">'https://jitpack.io'</span> <span class="token punctuation">}</span>
|
|
27
|
-
<span class="token punctuation">}</span>
|
|
28
|
-
<span class="token punctuation">}</span>
|
|
29
|
-
</code></pre></div><h2 id="running-the-example-project" tabindex="-1"><a class="header-anchor" href="#running-the-example-project" aria-hidden="true">#</a> Running the example project</h2><p>To run the example project, first clone this repo:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">git</span> clone git@github.com:listenzz/hybrid-navigation.git
|
|
30
|
-
<span class="token builtin class-name">cd</span> hybrid-navigation
|
|
31
|
-
</code></pre></div><h3 id="run-on-android" tabindex="-1"><a class="header-anchor" href="#run-on-android" aria-hidden="true">#</a> run on Android</h3><p>First, make sure that you have a simulator or device.</p><p>Then,</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">npm</span> <span class="token function">install</span>
|
|
32
|
-
<span class="token comment"># &</span>
|
|
33
|
-
<span class="token function">npm</span> start
|
|
34
|
-
</code></pre></div><p>Then, in another CLI window:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">npm</span> run run:android
|
|
35
|
-
</code></pre></div><p><a href="https://raw.githubusercontent.com/listenzz/hybrid-navigation/master/screenshot/app-release.apk" target="_blank" rel="noopener noreferrer"><strong>Download demo apk</strong><span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></p><p>或通过扫描二维码安装 demo</p><p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAARHUlEQVR4Xu2d4XIivQ5Ev7z/Q++tygK3mA0cnZE8kKHzV7YstbolDxD4+vPnz5//8hcEgsCPCHxFIGFGEHiMQAQSdgSBJwhEIKFHEIhAwoEgsA+BTJB9uGXXhyAQgXxIoZPmPgQikH24ZdeHIBCBfEihk+Y+BCKQfbhl14cgEIF8SKGT5j4EIpB9uGXXhyAQgXxIoZPmPgQikH24ZdeHIBCBfEihk+Y+BCKQfbhl14cgEIF8SKGT5j4EIpB9uGXXhyAwJpCvr69DIaN/hNzGs11v7dvkyJ8Fg/x17TZ+i6/1b/Gx6yn+qr8I5IIUEXA1Aej8rt3GTwSjhkjxVgm6dx3FX/UbgUQg3wjQRN0SKgKpSuyyjgCT7nA5dQgquLXbDowJbBZQx+3abfwWX+vf4mPXU/xVf8smyFSA10Qsoen8dxM0dWibDwmKCF0lUHUd1a/q59G6Vf4jkG5livuJ4BFIEcgHyyKQzatk1CGJkJkg90wjvHr09c849rwIJAJ5yhkiCDWECORneA+7YlGB6E5MBKArivVv19NEs/5o/XSH7eJLAiP/R/Ojil8EckGKCkQCIDsR3p5fLfBRL3JEIFCRd+sQlnDd9RHI8694fjd+VBtMJkgmyDcCRGC6wmaCvPkEoQJP26kDEWEs4Sh+8kdXPNpv87H+aIJT/BYfqt/tajr17e4U4GoA7Pl0JSI7AWwJ1Y2fCEkEo/02H+tvNT+oXo/sp7lidQlm9xPgllD2fPJPhLP7aT3hYfMjf9TAuvFmgmx+N2h1Aang9nwiQAQy87tQp5kgdqQTYcluCT19xaHzp/EgwVF+FO9q/1TP01+xpglBgHYLbidA90pB8dp8ab2NNwKR/3FoAY5Aeu9DEOFXE3i1f8ovE2T4t0qpI1PBM0HuBU14da9wby+QvQHeXk0Y/rAixWMLRgWcPo8ERhO1Gy/5794ACC97vvV3+KtYewOMQH5GLgK5x4Um+l7+HfYq1t4AI5AIpMKdCCRXrDueZIL88glSUX1njb3jUoeJ/f57zVbj26l9Za9tIIe/ilVJorNmdQHj//mrTF18OrWv7I1Amh8V6RY4+3sCqpC8syYCiUDu+PPbrogd8lf2vp1AKkEfuWb1+xhEyG6uFL+dYKvfN1iNRxfPvfvHXubdG8CqfUQwOpc60GpCUPwRCFVwxh6BPMAxAnEEW90wXDRzqyOQCOQbAWoIRLkIBBCiKwEBvLXTFYL8UcGPjtfGQ/mv9tclPO1fbSd+VO1jE+RowlGClkDkj+yvJrR9CO8SlPDo+u/up/iq9gikihSsi0DuAeoSvLt/qKz/RSBDSEYgEYii0uorV/dKQc88KtnCF69ZPOwVkdZTPhQfNQDCk/xTfJQfTRzy/8g+NkGIsHsDvO7rAkQFIv8UPxWIzieCEb7T8VM8lI8VFOFL+RH+5D8Cgf+JpwIQwFQgIhQRMgJZ+z/3EUgE8lTjJGA7Eex6akDUwKhBkf+XC4QSpAQsAFRw27G7HZziJzvhY+ObxsfGT+d3+WLxikAAMVuQLiGow9p4IpApSdz7OewhfXXBiSAEn40vAtkQCf4l2tbH1oPqu9cegVyQswWJQCIQJToiDN05p58JyB/FY69AlD91UDpPFaPw4cPV+RP+hAftt/Fb/K7rxyYIEYQSIkAoQfJvCUjrrZ0IQf4of4tfFy8bL03objw2/yqeEcgDpIgA1h6BuPcxiPBWUFVB/FOn3/ILU5SgBay7PgJx36378RPkt3VIEhwVlPZbPKbX2/ho/dF4UAOjCUP5VO1jVyxbYAuABWS1/yrAt4e95sugRNBuvpQPnU/7V/NjOr7xh/TVAEQgvTu8JbDF2/p/9Ys61XgzQYoP6VVAH60jQtgGQ+u78UYgfxEYEwiNeHqopYLa/bSeRjLlQ/Fagk0LaNrfuwvS5lutXwTyAKkI5Hdd6SIQ+KpR6tgWwAgkAskV68mcjUAikKUCsc8A1OGJsN3zaAJV76y3lweHf/Cniw/FT/gdjQ8989AzJOVbtS97BiHAu3YqWJdQ3QLY8+k8669KgOs6qgfhbc+jfCKQ5s8XUMGoAHYiTROA4rMEoXwo/gjkZ4QyQR4whzo6EY4EQPYI5B4BixfVp2ofE0j1wFXrLIDT68nf6g5vBU3xUp3sflpP+NCEs/lTfrdnyalP81YPXLWOCmA7sl1P5xMBCJdpglC8FI/dT+sJn+n8Kb8IZPjDg10CUMGmCULxUjx2P62PQAjxpp0KYCeCXU/nEwEo/QjE/Wgo4Vm1L3sGWU2YbYJEoCog1XV057X5W3/T+RN+0/FVcb5ddeTEt/4frY9AdiJpCXM0Ae3EOjo+Czs1HOuvuj4CqSK1WReB3ANCgiS8qAwRCCEEduqATff/bKeCU0HJTs9AuWI9/6zYVL3HJki3g1jCEADkj+IlAloCU7x0HsVLgqXzp/Gi88hO+azG4/bsM/U+SDdgKhABSoTtTphuwWz8Nl6Kj84n/Km+5N/aKR+Kh/ZX48kEKSJFgFPBisfclkUgvY/bU72q9YhAikgR4BFIEcjisi7etL8Yxtz/pNMVp3vHriZ0XWcBmiY45Ut40QSZzo/Os/nYer3r+rEJQgUngKcJOk2gbgEpHvsMQP5W18Oe38XvVfsjkAvy0wKlhkAEpo5uCUr50Xk2n1cRevrcCCQC+UYgAvlZWmMCsR2KlE5XDtuB7Xo6n/Kl/OwEIH/T8U7HZ+N/l4kVgVwqQR2U7ESA1QWPQGwFausjkAjkR6ZkgvyFJQKJQCKQJ8NkmUBsB7JXhK5/e+V5dXy1C8G6VfaKSfWxeNrM6PyqvwjkwQSZfqingnQf+sl/1x6BNBGkjkDuaT/Zrf9MEELs3h6BOLz+WT1NYCqIHaHUockf5Ud2gpfio/2r7VSP1Q3H5kf1rPo77IpFBLAJESHJbq9QR6+nAr4aT4rPCooERvUkO8X7yB6BXJCxAK9eTwWNQI75lpMIJAL5RoAET4K0E4AaAE0ga6fzMkE2X5Z99JWJCGgLSIRdfWWleInA3f3k3+a/XCDThCMAu3YCkAhI59sCrhYQxUMTgPKl+KfxpHim7GNXrAjkHgEipLXbgncJSw3E1jsC2SBGBSKALSHseiLAdEEJD7Lb/Mgf5Uf4UP2oAdh8bDzWf65YGwQIcCIQFYAIYu103jRhCZ/p8yg/Gw/5q9rHrljTHWvaHwFy9HndeGg/EfjVzxzUICg+qpfFZ/kEoYCpIxNgZCdACbDp+Ok8slM8tD8CsQj9vD4T5IILEdIKvFseisf6n46f4rPnddevuoJFIBHINwKWYBGIbFHUAaQ7vZyuYESAbvzd8ynhLiHJP9kJP9pPVz7yb+tD/qrxLpsg1QCm1nUJagtAzzxEaJs3+evGT/FMEe56DuVDgjoq3gjkwRWLChCBWITu10cgPfz07kyQL42Z2ZAJYtAaWEsdxNoppK6AyL+1T1+JuvlRPOTf5k/rrSCJL3TeI/vYFcsGQAlZO51PBbYFofPIToSk/dNXPIqH8LPx0npbD+ILnReBbD7uvgrQaiGIkFU/13VEYCIcxUP+bby0nuLd7l9Vz0yQC9K2IFRgshMhaX8myD0Cby8QCtASgjqWtVvC0XrKx8Zn/dkOutp/Nx7CixoC1WuvfWyCRCD3JaCCk90Soos/TVDyH4GABAlA6mBECOufCr63o1z3UT4kALITHl1CTvvvxjONR7e+tzqv+pVbmzAVLAJxP2pp8aeGQvhHIM0JQorudmQrMFpPBad8iHBH+6d4SQDWTudZ/Akvi3c1vsOeQSigCMS9Ez5NCCsAO6Go/jYfipfOq9ojkAtSVCAS8HRHpAJSvLTfdmQipMVnGq9pPA5/BqGCEcC2Y3XXE4EoH1swyr9LKIrXCsDiS+d38bL7KZ5xgRChugkQgcg/7bcEJEJ18SD/Np/V+XXzpf1VQl/XER+q/sauWJRgN2AiBPmn/asJRIS3+Nl8Vudn4yeCrs6Pzs8EAYSs4I5ev5pAVtARSFVyl3VdgAnwbkekdI4mPOV79J2/W7/p/VQvy4eqv7Er1nRHI4DpPCIUCYAISwB3/VP8RAjCj/Kz5xMeXbuNx+L/KL4IpFg5EiQRlo4hQtP5RCAiTPd8yq9rp/y6+EcgX/dvxBFhqMNSwbv+u4QgwlN+9nzCo2u38Vj8I5AI5ClHSVA0wboCoP2nE8iUgq/AUQGnO+J0/DY+IgzZVxOaCEv4UXy0n/Kfsi97BplOMAJxJScCOm//ro5AJIKWwNI9/oae7dBEoGmB2/gsPuS/648egm39X41/FY9MkAdIRSDPKZQJUpXYZd10B3m3jkX5WbuE958vl7Yd2MZHAqD62InWbUiUn8X79ux71H8UWsCoABYQSyiKlwhEdlsw64/Wd+1UH8LP7ie8LB/IXwSyQYg6GBXA2qsFuq4jQhPhbHzd8yKQDQJUAAtYt+D2vAjk+Rup0xOY6msbiOVf1f/bPKRTgmSvJnwbnZs3Du3+1YKy8RCBLSEt3vZ8ys9OMJsfnf/yKxZ1eAKICEoAdAtK5xPByE7xE360vxt/93wbn60X5UfnRyCZIE85YgVsCUwEpQZp99P6R/ZcsXYiRx2KCEZ2G5YlaDf+TBBboRevJ4JQRyI73XHpfAvPNIHp/KPjJ4HZelB9KP/lE2RvAFP7qMAEONmpAHS+zTMCuf8mSYsv4Vetx9gVq3rgqnUEIAmA7BGIq5wlKF05qb5UHxf9/1dHIBcsIhD3zY5EuAhkg5BVOAFM9i6hyb/Nh+KxhLF39Ol8qCMTPhYPO0G6eBJeV/vYBCHAqgFV11EBqMB0js2H4ukWlAg0nQ/hR/hYPCg/slP+e+0RyAPkiACWQBGI+yiLFdheAdC+CCQCIY5824mw3YZBE4LspSR2LFomkG7HnL6DEzY0MSgf2k/nk/8uHkQwstP5JBDK355P/qbsEcgFSSI4EZj2U8HIPxGU9hMByU7nRyBQYQswEYYKQoTo+rcFj0DuEbP1Wc0fy4fr+kyQTJBvBCxBqSFEIBtJEsAEKHXsaf90Hk0w6khdgpB/ip/wpvgI7y4+lB+9KGDtdN4j+2EThApmC04AWUAsYcg/+ZsmmMWD4otA/lYoArkw1RImArlHwDZAix8Jlux0XiYIIBSBPCf8ND5EWJqI1k7nfZxALIC2A9F66qhEOCqoPb97Hl0JV/snPOiKbvdf15/2ihWB9H7ugQhFAqX9ZKcGQ/unBBuBXJC2Baf1VOBuAe353fMyQUiSYLcFo+OmJ4CNjwhl/U1fAez5lA/VIwKxCG3W24LRcUcLhOKhiUACsPjY/Lvx03k2P4rHnkfn03l77bliFZGLQO6BmiZ4F99iGfWyCKQIWbeAmSBrBVYso14WgRQhi0DWEryLb7GMetlhAtGRDT/j0EMqdfh3e0ilKw7ZqR4WL3pGIAFQvNZO+VXtEcgFqQjk+YSgBhGBgOQswaoKvq4j/7ZDUcFtB6X13XwtAanjUjyUj8W7u57yoXgp30f2TJBMkB+5QYTrEn5a8BTv2wlkb0DVfdRRqAA0QapxVNdRAe2E7OY/fZ7Nr1sfOq9aF1q3bILQwV17lyARyLFfw2MnDtUnAgEFRSDuy50Jr2k7ETwTpDsiIpA7BOyViAho/VkBRSCLBRD3QeAdEBh7BnmHZBJDEJhGIAKZRjT+ToVABHKqciaZaQQikGlE4+9UCEQgpypnkplGIAKZRjT+ToVABHKqciaZaQQikGlE4+9UCEQgpypnkplGIAKZRjT+ToVABHKqciaZaQQikGlE4+9UCEQgpypnkplGIAKZRjT+ToVABHKqciaZaQQikGlE4+9UCEQgpypnkplG4H+aVZsCA1kKogAAAABJRU5ErkJggg==" alt="demo-qrcode"></p><h3 id="run-on-ios" tabindex="-1"><a class="header-anchor" href="#run-on-ios" aria-hidden="true">#</a> run on iOS</h3><p>First,</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">npm</span> <span class="token function">install</span>
|
|
36
|
-
<span class="token comment"># &</span>
|
|
37
|
-
<span class="token builtin class-name">cd</span> ios <span class="token operator">&&</span> pod <span class="token function">install</span>
|
|
38
|
-
<span class="token comment"># &</span>
|
|
39
|
-
<span class="token function">npm</span> start
|
|
40
|
-
</code></pre></div><p>Then, in another CLI window:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">npm</span> run run:ios
|
|
41
|
-
</code></pre></div><h2 id="目录" tabindex="-1"><a class="header-anchor" href="#目录" aria-hidden="true">#</a> 目录</h2><ul><li><p><a href="/rn/hybrid-navigation/integration-react.html" class=""><strong>集成到以 RN 为主的项目</strong></a></p></li><li><p><a href="/rn/hybrid-navigation/integration-native.html" class=""><strong>为原生项目添加 RN 模块</strong></a></p></li><li><p><a href="/rn/hybrid-navigation/navigation.html" class=""><strong>容器与导航</strong></a></p></li><li><p><a href="/rn/hybrid-navigation/pass-and-return-value.html" class=""><strong>RN 页面与原生页面相互跳转和传值</strong></a></p></li><li><p><a href="/rn/hybrid-navigation/lifecycle.html" class=""><strong>可见性监听</strong></a></p></li><li><p><a href="/rn/hybrid-navigation/style.html" class=""><strong>设置样式</strong></a></p></li><li><p><a href="/rn/hybrid-navigation/deeplink.html" class=""><strong>DeepLink</strong></a></p></li><li><p><a href="/rn/hybrid-navigation/qa.html" class=""><strong>常见问题</strong></a></p></li></ul><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">上次更新: </span><span class="meta-item-info">10/11/2021, 2:02:30 PM</span></div><!----></footer><!----><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
|
|
42
|
-
<script src="/rn/hybrid-navigation/assets/js/runtime~app.19128f21.js" defer></script><script src="/rn/hybrid-navigation/assets/js/812.0c9a2f53.js" defer></script><script src="/rn/hybrid-navigation/assets/js/app.a66f731a.js" defer></script>
|
|
43
|
-
</body>
|
|
44
|
-
</html>
|