From 1a8738648a67922ca4cbe5a2c6c9a39c81132f1b Mon Sep 17 00:00:00 2001 From: zhouyong <550468167@qq.com> Date: Fri, 12 Dec 2025 15:03:07 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[Issue:=20#IDB8P4]=E4=BF=AE=E6=94=B9rea?= =?UTF-8?q?ct-native-turbo-log=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en/react-native-turbo-log.md | 22 ++++++++++++++-------- zh-cn/react-native-turbo-log.md | 2 ++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/en/react-native-turbo-log.md b/en/react-native-turbo-log.md index 6f37c004..6408ed4c 100644 --- a/en/react-native-turbo-log.md +++ b/en/react-native-turbo-log.md @@ -13,16 +13,21 @@ Please refer to the Releases page of the third-party library for the matching ve > [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-turbo-log) +## Installation and Usage + +Go to the project directory and execute the following instruction: + #### npm ```bash -npm install @@react-native-ohos/react-native-turbo-log +npm install @react-native-ohos/react-native-turbo-log ``` #### yarn + ```bash -yarn add @@react-native-ohos/react-native-turbo-log +yarn add @react-native-ohos/react-native-turbo-log ``` @@ -162,13 +167,13 @@ const styles = StyleSheet.create({ ## Using Codegen Version >= @react-native-ohos/react-native-turbo-log@0.6.1, which has been adapted to codegen-lib to generate bridge code. -This library has been adapted to Codegen. Before using it, you need to actively execute the generation of third-party library bridge code. For details, please refer to the Codegen Usage Documentation. +This library has been adapted to Codegen. Before using it, you need to actively execute the generation of third-party library bridge code. For details, please refer to the [ Codegen Usage Documentation](/en/codegen.md). ## Link This step is a guide for manually configuring native dependencies. First, you need to open the HarmonyOS project harmony in the project using DevEco Studio. -### Add overrides field to oh-package.json in the project root directory +### 1. Add overrides field to oh-package.json in the project root directory ```json { @@ -180,7 +185,7 @@ First, you need to open the HarmonyOS project harmony in the project using DevEc } ``` -There are currently two methods: + ### 2. There are currently two methods: Import via har package (this method will be deprecated after the IDE improves related functions, and it is the preferred method currently); Link source code directly. @@ -194,7 +199,7 @@ Open the entry/oh-package.json5 file and append the following dependencies: ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-ohos/react-native-turbo-log": "file:../../node_modules/@@react-native-ohos/react-native-turbo-log/harmony/turbo_log.har" + "@react-native-ohos/react-native-turbo-log": "file:../../node_modules/@react-native-ohos/react-native-turbo-log/harmony/turbo_log.har" } ``` @@ -212,7 +217,7 @@ Method 2: Link the source code directly > [!TIP] For direct source code linking, refer to [Direct Source Code Linking Instructions](/zh-cn/link-source-code.md) -### 4.Configure CMakeLists and import turbo_log +### 3.Configure CMakeLists and import turbo_log open entry/src/main/cpp/CMakeLists.txt,add: @@ -260,8 +265,9 @@ target_link_libraries(rnoh_app PUBLIC rnoh_gesture_handler) # RNOH_END: manual_package_linking_2 ``` +### 4.在 ArkTs 侧引入 TurboLogPackage -打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: +open `entry/src/main/cpp/PackageProvider.cpp`,add: ```diff #include "RNOH/PackageProvider.h" diff --git a/zh-cn/react-native-turbo-log.md b/zh-cn/react-native-turbo-log.md index 6841e7d6..a98607af 100644 --- a/zh-cn/react-native-turbo-log.md +++ b/zh-cn/react-native-turbo-log.md @@ -273,6 +273,8 @@ target_link_libraries(rnoh_app PUBLIC rnoh_gesture_handler) ``` +### 4.Import the TurboLogPackage on the ArkTS side + 打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: ```diff -- Gitee