From 56fc1759f67f2353a747d6ebd75302dfcb439016 Mon Sep 17 00:00:00 2001 From: cold-zone Date: Mon, 11 Aug 2025 18:53:02 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[Issues:#ICSF2D]=20=E6=B7=BB=E5=8A=A00.?= =?UTF-8?q?77=203=E4=B8=AA=E4=B8=89=E6=96=B9=E5=BA=93=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-native-community-push-notification-ios.md | 44 ++++++++++++++++--- zh-cn/react-native-linear-gradient.md | 36 ++++++++++++--- zh-cn/react-native-picker.md | 44 ++++++++++++++++--- 3 files changed, 106 insertions(+), 18 deletions(-) diff --git a/zh-cn/react-native-community-push-notification-ios.md b/zh-cn/react-native-community-push-notification-ios.md index 60cd6858..fc662215 100644 --- a/zh-cn/react-native-community-push-notification-ios.md +++ b/zh-cn/react-native-community-push-notification-ios.md @@ -8,10 +8,12 @@ 该第三方库的仓库已迁移至 Gitee,且支持直接从 npm 下载,新的包名为:`@react-native-ohos/push-notification-ios`,具体版本所属关系如下: -| Version | Package Name | Repository | Release | -|----------------------------| ------------------------------------------------- | ------------------ | -------------------------- | -| <= 1.11.0-0.1.3@deprecated | @react-native-oh-tpl/push-notification-ios | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-push-notification-ios) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-push-notification-ios/releases) | -| > 1.11.0 | @react-native-ohos/push-notification-ios | [GitCode](https://gitcode.com/openharmony-sig/rntpc_ios) | [GitCode Releases](https://gitcode.com/openharmony-sig/rntpc_ios/releases) | +| Version | Package Name | Repository | Release | Version for RN | +| ------------------------- | ------------------------------------------------- | ------------------ | -------------------------- | ------------------------- | +| <= 1.11.0-0.1.3@deprecated | @react-native-oh-tpl/push-notification-ios | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-push-notification-ios) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-push-notification-ios/releases)| 0.72 | +| > 1.11.0 | @react-native-ohos/push-notification-ios | [GitCode](https://gitcode.com/openharmony-sig/rntpc_ios) | [GitCode Releases](https://gitcode.com/openharmony-sig/rntpc_ios/releases) | 0.77 | + + ## 1. 安装与使用 @@ -22,12 +24,20 @@ #### **npm** ```bash +#<= v1.11.0-0.1.3 +npm install @react-native-oh-tpl/push-notification-ios + +#> v1.11.0 npm install @react-native-ohos/push-notification-ios ``` #### **yarn** ```bash +#<= v1.11.0-0.1.3 +yarn add @react-native-oh-tpl/push-notification-ios + +#> v1.11.0 yarn add @react-native-ohos/push-notification-ios ``` @@ -195,7 +205,13 @@ export const App = () => { > [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 打开 `entry/oh-package.json5`,添加以下依赖 - +- <= V1.11.0-0.1.3 +```json +"dependencies": { + "@react-native-ohos/push-notification-ios": "file:../../node_modules/@react-native-oh-tpl/push-notification-ios/harmony/push_notification.har" + } +``` +- \> V1.11.0 ```json "dependencies": { "@react-native-ohos/push-notification-ios": "file:../../node_modules/@react-native-ohos/push-notification-ios/harmony/push_notification.har" @@ -223,6 +239,10 @@ ohpm install + set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") # RNOH_BEGIN: manual_package_linking_1 +# <= V1.11.0-0.1.3 ++ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/push-notification-ios/src/main/cpp" ./push_notification) + +# > V1.11.0 + add_subdirectory("${OH_MODULES}/@react-native-ohos/push-notification-ios/src/main/cpp" ./push_notification) # RNOH_END: manual_package_linking_1 @@ -254,6 +274,10 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... + //<= V1.11.0-0.1.3 ++ import { PushNotificationPackage } from '@react-native-oh-tpl/push-notification-ios/ts'; + + //> V1.11.0 + import { PushNotificationPackage } from '@react-native-ohos/push-notification-ios/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -270,6 +294,10 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { ```diff ... +//<= V1.11.0-0.1.3 ++ import { PushNotificationModule } from '@react-native-oh-tpl/push-notification-ios/ts'; + +//> V1.11.0 + import { PushNotificationModule } from '@react-native-ohos/push-notification-ios/ts'; ... onNewWant(want: Want, _launchParam: AbilityConstant.LaunchParam): void { @@ -294,7 +322,11 @@ ohpm install ### 3.1. 兼容性 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-ohos/push-notification-ios Releases](https://gitee.com/openharmony-sig/rntpc_ios/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| Version | Package Name | Repository | Release | Version for RN | +| ------------------------- | ------------------------------------------------- | ------------------ | -------------------------- | ------------------------- | +| <= 1.11.0-0.1.3@deprecated | @react-native-oh-tpl/push-notification-ios | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-push-notification-ios) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-push-notification-ios/releases)| 0.72 | +| > 1.11.0 | @react-native-ohos/push-notification-ios | [GitCode](https://gitcode.com/openharmony-sig/rntpc_ios) | [GitCode Releases](https://gitcode.com/openharmony-sig/rntpc_ios/releases) | 0.77 | ## 4. API diff --git a/zh-cn/react-native-linear-gradient.md b/zh-cn/react-native-linear-gradient.md index 6da3ab66..1ac0df42 100644 --- a/zh-cn/react-native-linear-gradient.md +++ b/zh-cn/react-native-linear-gradient.md @@ -6,12 +6,14 @@ 本项目基于 [react-native-linear-gradient@3.0.0-alpha.1](https://github.com/react-native-linear-gradient/react-native-linear-gradient) 开发。 -该第三方库的仓库已迁移至 Gitee,且支持直接从 npm 下载,新的包名为:`@react-native-ohos/react-native-linear-gradient`,具体版本所属关系如下: +该第三方库的仓库已迁移至 gitcode,且支持直接从 npm 下载,新的包名为:`@react-native-ohos/react-native-linear-gradient`,具体版本所属关系如下: + +| Version | Package Name | Repository | Release | Version for RN | +| ------------------------- | ------------------------------------------------- | ------------------ | -------------------------- | ------------------------- | +|<= 3.0.0-0.5.0@deprecated | @react-native-oh-tpl/react-native-linear-gradient | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient/releases) | 0.72 | +| > 3.0.0 | @react-native-ohos/react-native-linear-gradient | [Gitcode](https://gitcode.com/openharmony-sig/rntpc_react-native-linear-gradient) | [Gitcode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-linear-gradient/releases) | 0.77 | + -| Version | Package Name | Repository | Release | -| ------------------------- | ------------------------------------------------- | ------------------ | -------------------------- | -| <= 3.0.0-0.5.0@deprecated | @react-native-oh-tpl/react-native-linear-gradient | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient/releases) | -| > 3.0.0 | @react-native-ohos/react-native-linear-gradient | [Gitee](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient) | [Gitee Releases](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases) | ## 1. 安装与使用 @@ -22,12 +24,20 @@ #### **npm** ```bash +# <= V3.0.0 +npm install @react-native-oh-tpl/react-native-linear-gradient + +# > V3.0.0 npm install @react-native-ohos/react-native-linear-gradient ``` #### **yarn** ```bash +# <= V3.0.0 +yarn add @react-native-oh-tpl/react-native-linear-gradient + +# > V3.0.0 yarn add @react-native-ohos/react-native-linear-gradient ``` @@ -122,7 +132,15 @@ var styles = StyleSheet.create({ > [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 打开 `entry/oh-package.json5`,添加以下依赖 +- \<=V3.0.0 +```json +"dependencies": { + "@react-native-oh-tpl/react-native-linear-gradient": "file:../../node_modules/@react-native-oh-tpl/react-native-linear-gradient/harmony/linear_gradient.har" + } +``` + +- \>V3.0.0 ```json "dependencies": { "@react-native-ohos/react-native-linear-gradient": "file:../../node_modules/@react-native-ohos/react-native-linear-gradient/harmony/linear_gradient.har" @@ -192,7 +210,11 @@ ohpm install ### 3.1 兼容性 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-ohos/react-native-linear-gradient Releases](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| Version | Package Name | Repository | Release | Version for RN | +| ------------------------- | ------------------------------------------------- | ------------------ | -------------------------- | ------------------------- | +|<= 3.0.0-0.5.0@deprecated | @react-native-oh-tpl/react-native-linear-gradient | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient/releases) | 0.72 | +| > 3.0.0 | @react-native-ohos/react-native-linear-gradient | [Gitcode](https://gitcode.com/openharmony-sig/rntpc_react-native-linear-gradient) | [Gitcode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-linear-gradient/releases) | 0.77 | ## 4. 属性 @@ -216,4 +238,4 @@ ohpm install ## 6. 开源协议 -本项目基于 [The MIT License (MIT)](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/blob/master/LICENSE),请自由地享受和参与开源。 +本项目基于 [The MIT License (MIT)](https://Gitcode.com/openharmony-sig/rntpc_react-native-linear-gradient/blob/master/LICENSE),请自由地享受和参与开源。 diff --git a/zh-cn/react-native-picker.md b/zh-cn/react-native-picker.md index 31abd460..2b4d1070 100644 --- a/zh-cn/react-native-picker.md +++ b/zh-cn/react-native-picker.md @@ -16,22 +16,40 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-picker Releases](https://github.com/react-native-oh-library/react-native-picker/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 + + +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 4.4.0 | [@react-native-oh-tpl/react-native-picker Releases](https://github.com/react-native-oh-library/react-native-picker/releases) | 0.72 | +| 4.4.1 | [@react-native-ohos/react-native-picker Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: + + #### **npm** ```bash +# V4.4.0 npm install @react-native-oh-tpl/react-native-picker + +# V4.4.1 +npm install @react-native-ohos/react-native-picker ``` #### **yarn** ```bash +# V4.4.0 yarn add @react-native-oh-tpl/react-native-picker + +# V4.4.1 +yarn add @react-native-ohos/react-native-picker ``` @@ -139,13 +157,20 @@ export default MyPicker; 打开 `entry/oh-package.json5`,添加以下依赖 +- V4.4.0 ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", "@react-native-oh-tpl/react-native-picker": "file:../../node_modules/@react-native-oh-tpl/react-native-picker/harmony/picker.har" } ``` - +- V4.4.1 +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-oh-tpl/react-native-picker": "file:../../node_modules/@react-native-ohos/react-native-picker/harmony/picker.har" + } +``` 点击右上角的 `sync` 按钮 或者在终端执行: @@ -181,7 +206,11 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) +# V4.4.0 + add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-picker/src/main/cpp" ./picker) + +# V4.4.1 ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-picker/src/main/cpp" ./picker) # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -221,10 +250,12 @@ std::vector> PackageProvider::getPackages(Package::Cont ### 4.在 ArkTs 侧引入 PickerViewPackage 打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: - ```diff ... + // V4.4.0 + import { PickerViewPackage } from "@react-native-oh-tpl/react-native-picker/ts" + // V4.4.1 ++ import { PickerViewPackage } from "@react-native-ohos/react-native-picker/ts" export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -232,7 +263,6 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { ]; } ``` - ### 5.运行 点击右上角的 `sync` 按钮 @@ -252,7 +282,11 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-picker Releases](https://github.com/react-native-oh-library/react-native-picker/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 4.4.0 | [@react-native-oh-tpl/react-native-picker Releases](https://github.com/react-native-oh-library/react-native-picker/releases) | 0.72 | +| 4.4.1 | [@react-native-ohos/react-native-picker Releases]() | 0.77 | ## 属性 -- Gitee