From 9ff99a5600b5a021475eeb053b9192a25a452ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=90=A6?= Date: Fri, 30 Jan 2026 17:56:25 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[Issues:=20#IDNF89]=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9react-native-vector-drawable=E6=8C=87=E5=AF=BC?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李琦 --- en/react-native-vector-drawable.md | 22 ++++++++++++++++++++-- zh-cn/react-native-vector-drawable.md | 24 +++++++++++++++++++++--- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/en/react-native-vector-drawable.md b/en/react-native-vector-drawable.md index d119324a..6f5fc5a1 100644 --- a/en/react-native-vector-drawable.md +++ b/en/react-native-vector-drawable.md @@ -18,6 +18,13 @@ Find the matching version information in the release address of a third-party library:[@react-native-oh-library/react-native-vector-drawable Releases](https://github.com/react-native-oh-library/react-native-vector-drawable/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. +| Name | Version | Release Information | Supported RN Version | Supported Autolink | Compile API Version | Community Baseline Version | npm Address +| ------------ |--------|---------------------------------------------------------------------------------------------|----------------------|--------------------|---------|--------|----------------------------------| +|@react-native-ohos/react-native-vector-drawable| ~0.6.1 | [Github Releases](https://Github.com/openharmony-sig/rntpc_react-native-vector-drawable/releases) | 0.82.* | 否 | API12+ | 0.5.1 | [Npm Address](https://www.npmjs.com/package/@react-native-ohos/react-native-vector-drawable)| +|@react-native-ohos/react-native-vector-drawable| ~0.5.2 | [Github Releases](https://Github.com/openharmony-sig/rntpc_react-native-vector-drawable/releases) | 0.77.* | 否 | API12+ | 0.5.1 | [Npm Address](https://www.npmjs.com/package/@react-native-ohos/react-native-vector-drawable)| +|@react-native-oh-tpl/react-native-vector-drawable| ~0.5.1 | [Github Releases](https://github.com/react-native-oh-library/react-native-vector-drawable/releases) | 0.72.* | 否 | API12+ | 0.5.0 | [Npm Address](https://www.npmjs.com/package/@react-native-oh-tpl/react-native-vector-drawable) | + + Go to the project directory and execute the following instruction: @@ -57,14 +64,25 @@ export default function VectorDrawableDemo(): JSX.Element { } ``` +## Link + +| | Is supported autolink | Supported RN Version | +|---------------------------|-----------------|------------| +| ~0.6.2 | No | 0.82 | +| ~0.5.2 | No | 0.77 | +| ~0.5.1 | No | 0.72 | + ## Constraints ### Compatibility To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-vector-drawable Releases](https://github.com/react-native-oh-library/react-native-vector-drawable/releases) - +Verified in the following versions: +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +4. RNOH: 0.82.1; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ## Properties In the original library, the Android platform implements the loading of[xml vector images](https://github.com/klarna-incubator/react-native-vector-drawable/blob/master/example/android/app/src/main/res/drawable/ic_klarna_logo.xml) through the android.graphics.drawable.Drawable method,On the iOS platform,it is achieved through the[React-Native View](https://reactnative.cn/docs/view)HarmonyOS aligns with iOS in this regard, and the properties are the same as those described in the[React-Native View](https://reactnative.cn/docs/view) diff --git a/zh-cn/react-native-vector-drawable.md b/zh-cn/react-native-vector-drawable.md index bd254d0a..4ee14e15 100644 --- a/zh-cn/react-native-vector-drawable.md +++ b/zh-cn/react-native-vector-drawable.md @@ -18,9 +18,13 @@ 请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/react-native-vector-drawable Releases](https://github.com/react-native-oh-library/react-native-vector-drawable/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 -进入到工程目录并输入以下命令: - +| 三方库名称 | 三方库版本 | 发布信息 | 支持RN版本 | Autolink | 编译API版本 | 社区基线版本 | npm地址 +| ------------ |--------|---------------------------------------------------------------------------------------------|----------------------|--------------------|---------|--------|----------------------------------| +|@react-native-ohos/react-native-vector-drawable| ~0.6.1 | [Github Releases](https://Github.com/openharmony-sig/rntpc_react-native-vector-drawable/releases) | 0.82.* | 否 | API12+ | 0.5.1 | [Npm Address](https://www.npmjs.com/package/@react-native-ohos/react-native-vector-drawable)| +|@react-native-ohos/react-native-vector-drawable| ~0.5.2 | [Github Releases](https://Github.com/openharmony-sig/rntpc_react-native-vector-drawable/releases) | 0.77.* | 否 | API12+ | 0.5.1 | [Npm Address](https://www.npmjs.com/package/@react-native-ohos/react-native-vector-drawable)| +|@react-native-oh-tpl/react-native-vector-drawable| ~0.5.1 | [Github Releases](https://github.com/react-native-oh-library/react-native-vector-drawable/releases) | 0.72.* | 否 | API12+ | 0.5.0 | [Npm Address](https://www.npmjs.com/package/@react-native-oh-tpl/react-native-vector-drawable) | +进入到工程目录并输入以下命令: @@ -57,14 +61,28 @@ export default function VectorDrawableDemo(): JSX.Element { } ``` + +## Link + +| | 是否支持autolink | RN框架版本 | +|---------------------------|-----------------|------------| +| ~0.6.2 | No | 0.82 | +| ~0.5.2 | No | 0.77 | +| ~0.5.1 | No | 0.72 | + + ## 约束与限制 ### 兼容性 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/react-native-vector-drawable Releases](https://github.com/react-native-oh-library/react-native-vector-drawable/releases) +在以下版本验证通过: +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +4. RNOH: 0.82.1; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ## 属性 原库中Android平台实现是通过android.graphics.drawable.Drawable方法加载[xml矢量图片](https://github.com/klarna-incubator/react-native-vector-drawable/blob/master/example/android/app/src/main/res/drawable/ic_klarna_logo.xml)文件,在iOS平台是通过[React-Native View](https://reactnative.cn/docs/view)来实现,HarmonyOS与iOS保持一致,属性见[React-Native View组件](https://reactnative.cn/docs/view) -- Gitee