From 495c7623d1b347a983eb7fce4d4d1d2d5fefe5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=BD=B3=E4=BB=8A?= <10284872+wedatahub@user.noreply.gitee.com> Date: Wed, 22 Nov 2023 12:05:53 +0800 Subject: [PATCH 1/6] add linearGradientReadme --- README.md | 1 + zh-cn/react-native-linear-gradient.md | 236 ++++++++++++++++++++++++++ 2 files changed, 237 insertions(+) create mode 100644 zh-cn/react-native-linear-gradient.md diff --git a/README.md b/README.md index 7118baf7..ed8f95c0 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ | 4 | @react-native-community/slider | 4.4.3 | 是 | 90% | [@react-native-oh-library/slider@4.4.3-0.1.1](https://github.com/react-native-oh-library/react-native-slider/releases/tag/4.4.3-0.1.1) | [链接](zh-cn/react-native-slider.md) | | 5 | @react-native-masked-view/masked-view | 0.2.9 | 否 | 90% | [@react-native-oh-library/masked-view@0.2.9-0.0.1](https://github.com/react-native-oh-library/masked-view/releases/tag/0.2.9-0.0.1) | [链接](zh-cn/react-native-masked-view.md) | | 6 | @react-native-community/checkbox | 0.5.16 | 否 | 100% | [@react-native-oh-library/checkbox@0.5.16-0.0.2](https://github.com/react-native-oh-library/react-native-checkbox/releases/tag/0.5.16-0.0.2) | [链接](zh-cn/react-native-checkbox.md) | +| 7 | react-native-linear-gradient | 3.0.0-alpha.1 | 是 | 100% | [@react-native-oh-library/react-native-linear-gradient@3.0.0-alpha.1-0.2.4](https://github.com/react-native-oh-library/react-native-linear-gradient/releases/tag/3.0.0-alpha.1-0.2.4) | [链接](zh-cn/react-native-linear-gradient.md) | ## 社区 [react-native-oh-library](https://github.com/react-native-oh-library) \ No newline at end of file diff --git a/zh-cn/react-native-linear-gradient.md b/zh-cn/react-native-linear-gradient.md new file mode 100644 index 00000000..97c7ce2f --- /dev/null +++ b/zh-cn/react-native-linear-gradient.md @@ -0,0 +1,236 @@ + + +

+

react-native-linear-gradient

+

+

+ + Supported platforms + + + License + +

+ + +## 安装与使用 + +目前 React-Native-OpenHarmony(RNOH) 三方库的npm包部署在私仓,需要通过github token来获取访问权限。 + +在与 `package.json` 文件相同的目录中,创建或编辑 `.npmrc` 文件以包含指定 GitHub Packages URL 和托管包的命名空间的行。 将TOKEN替换为RNOH三方库指定的token。 +```json +@react-native-oh-library:registry=https://npm.pkg.github.com +//npm.pkg.github.com/:_authToken=TOKEN +``` + +进入到工程目录并输入以下命令: + +```bash +yarn add @react-native-linear-gradient@npm:@react-native-oh-library/react-native-linear-gradient +``` + +或者 + +```bash +npm install @react-native-linear-gradient@npm:@react-native-oh-library/react-native-linear-gradient +``` + +快速使用: + +```js +import LinearGradient from 'react-native-linear-gradient'; + + 1111 + 2222 + 3333 + +``` + +## Link + +目前鸿蒙暂不支持 AutoLink,所以Link步骤需要手动配置。 + +首先需要使用DevEco Studio打开项目里的鸿蒙工程 `harmony` + +### 引入原生端代码 + +目前有两种方法: + +1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法); +2. 直接链接源码。 + +方法一:通过 har 包引入 +打开 `entry/oh-package.json5`,添加以下依赖 + +```json +"dependencies": { + "rnoh": "file:../rnoh", + "rnoh-linear-gradient": "file:../../node_modules/react-native-linear-gradient/harmony/linear_gradient.har" + } +``` + +点击右上角的 `sync` 按钮 + +或者在终端执行: + +```bash +cd entry +ohpm install +``` + +方法二:直接链接源码 +打开 `entry/oh-package.json5`,添加以下依赖 + +```json +"dependencies": { + "rnoh": "file:../rnoh", + "rnoh-linear-gradient": "file:../../node_modules/react-native-linear-gradient/harmony/linear_gradient" + } +``` + +打开终端,执行: + +```bash +cd entry +ohpm install --no-link +``` + +### 配置CMakeLists和引入LinearGradientPackage + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(OH_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) + +# RNOH_BEGIN: add_package_subdirectories +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULE_DIR}/rnoh-linear-gradient/src/main/cpp" ./linear-gradient) +# RNOH_END: add_package_subdirectories + +add_library(rnoh_app SHARED + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) + +target_link_libraries(rnoh_app PUBLIC rnoh) + +# RNOH_BEGIN: link_packages +target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) ++ target_link_libraries(rnoh_app PUBLIC rnoh_linear_gradient) +# RNOH_END: link_packages +``` + +打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: + +```diff +#include "RNOH/PackageProvider.h" +#include "SamplePackage.h" ++ #include "LinearGradientPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { + std::make_shared(ctx), ++ std::make_shared(ctx) + }; +} +``` + + +### 在ArkTs侧引入 linear-gradient 组件 + +打开 `entry/src/main/ets/pages/index.ets`,添加: + +```diff +import { + RNApp, + ComponentBuilderContext, + RNAbility, + AnyJSBundleProvider, + MetroJSBundleProvider, + ResourceJSBundleProvider, +} from 'rnoh' +import { SampleView, SAMPLE_VIEW_TYPE, PropsDisplayer } from "rnoh-sample-package" +import { createRNPackages } from '../RNPackagesFactory' ++ import { RNLinearGradient, LINEAR_GRADIENT_TYPE, LinearGradientDescriptor } from "rnoh-linear-gradient" + +@Entry +@Component +struct Index { + @StorageLink('RNAbility') rnAbility: RNAbility | undefined = undefined + + @Builder + buildCustomComponent(ctx: ComponentBuilderContext) { + if (ctx.descriptor.type === SAMPLE_VIEW_TYPE) { + SampleView({ + ctx: ctx.rnohContext, + tag: ctx.descriptor.tag, + buildCustomComponent: this.buildCustomComponent.bind(this) + }) + } ++ else if (ctx.descriptor.type === LINEAR_GRADIENT_TYPE) { ++ RNLinearGradient({ ++ ctx: ctx.rnohContext, ++ tag: ctx.descriptor.tag, ++ buildCustomComponent: this.buildCustomComponent.bind(this) ++ }) ++ } + ... + } + ... +} +``` + +### 运行 + +点击右上角的 `sync` 按钮 + +或者在终端执行: +```bash +cd entry +ohpm install +``` + +然后编译、运行即可。 + + + +## 兼容性 +要使用此库,需要使用正确的React-Native和RNOH版本。另外,还需要使用配套的 DevEco Studio 和 手机ROM。 + +| `@react-native-oh-library/react-native-linear-gradient` Version | Required React Native Version | Required RNOH Version | Required DevEco Studio Version | Required ROM Version | +| ------------------------------------------------------------ | ----------------------------- | --------------------- | ------------------------------ | ----------------------- | +| 3.0.0-alpha.1-0.2.4 | `>=0.72.5` | `>=0.72.6` | `>=4.0.3.501` | `>=OpenHarmony 4.10.10` | + + +## 属性 + + +| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| ----------- | -------------------------------------------------------- | ---------------------- | -------- | -------- | -------- | +| colors | Color Array | (string\|number)[] | NO | All | yes | +| locations | Color for unknown array (length 0 or the same as colors) | number[] | NO | All | yes | +| useAngle | Use angle (default false) | boolean | NO | All | yes | +| angle | Angle (useAngle=true valid) | number | NO | All | yes | +| angleCenter | Middle angle coordinate | { x: number,y: number} | NO | All | yes | +| start | Starting point coordinates (default value: {x: 0.5,1}) | { x: number,y: number} | NO | All | yes | +| end | End point coordinates (default value: {x: 0.5,1}) | { x: number,y: number} | NO | All | yes | + +## 遗留问题 + +## 其他 + +## 开源协议 +本项目基于 [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-linear-gradient/blob/harmony/LICENSE) ,请自由地享受和参与开源。 \ No newline at end of file -- Gitee From 6023be1f5bdb444822e823c704394c9fe041a232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=BD=B3=E4=BB=8A?= <10284872+wedatahub@user.noreply.gitee.com> Date: Wed, 22 Nov 2023 19:05:21 +0800 Subject: [PATCH 2/6] linear-gradient.md --- zh-cn/react-native-linear-gradient.md | 28 ++++++++++++--------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/zh-cn/react-native-linear-gradient.md b/zh-cn/react-native-linear-gradient.md index 97c7ce2f..0e8811c0 100644 --- a/zh-cn/react-native-linear-gradient.md +++ b/zh-cn/react-native-linear-gradient.md @@ -7,11 +7,7 @@ Supported platforms - - License - -

- +

## 安装与使用 @@ -26,13 +22,13 @@ 进入到工程目录并输入以下命令: ```bash -yarn add @react-native-linear-gradient@npm:@react-native-oh-library/react-native-linear-gradient +yarn add react-native-linear-gradient@npm:@react-native-oh-library/react-native-linear-gradient ``` 或者 ```bash -npm install @react-native-linear-gradient@npm:@react-native-oh-library/react-native-linear-gradient +npm install react-native-linear-gradient@npm:@react-native-oh-library/react-native-linear-gradient ``` 快速使用: @@ -172,19 +168,19 @@ struct Index { @StorageLink('RNAbility') rnAbility: RNAbility | undefined = undefined @Builder - buildCustomComponent(ctx: ComponentBuilderContext) { - if (ctx.descriptor.type === SAMPLE_VIEW_TYPE) { + function CustomComponentBuilder(ctx: ComponentBuilderContext) { + if (ctx.componentName === SAMPLE_VIEW_TYPE) { SampleView({ ctx: ctx.rnohContext, tag: ctx.descriptor.tag, - buildCustomComponent: this.buildCustomComponent.bind(this) + buildCustomComponent: CustomComponentBuilder }) - } -+ else if (ctx.descriptor.type === LINEAR_GRADIENT_TYPE) { + } ++ else if (ctx.componentName === LINEAR_GRADIENT_TYPE) { + RNLinearGradient({ + ctx: ctx.rnohContext, + tag: ctx.descriptor.tag, -+ buildCustomComponent: this.buildCustomComponent.bind(this) ++ buildCustomComponent: CustomComponentBuilder + }) + } ... @@ -224,9 +220,9 @@ ohpm install | locations | Color for unknown array (length 0 or the same as colors) | number[] | NO | All | yes | | useAngle | Use angle (default false) | boolean | NO | All | yes | | angle | Angle (useAngle=true valid) | number | NO | All | yes | -| angleCenter | Middle angle coordinate | { x: number,y: number} | NO | All | yes | -| start | Starting point coordinates (default value: {x: 0.5,1}) | { x: number,y: number} | NO | All | yes | -| end | End point coordinates (default value: {x: 0.5,1}) | { x: number,y: number} | NO | All | yes | +| angleCenter | Middle angle coordinate | { x: number,y: number} | NO | All | no | +| start | Starting point coordinates (default value: {x: 0.5,1}) | { x: number,y: number} | NO | All | partial | +| end | End point coordinates (default value: {x: 0.5,1}) | { x: number,y: number} | NO | All | partial | ## 遗留问题 -- Gitee From 242526ec2051766a05fc13289b0daf587f5e263a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=BD=B3=E4=BB=8A?= <10284872+wedatahub@user.noreply.gitee.com> Date: Wed, 22 Nov 2023 19:10:06 +0800 Subject: [PATCH 3/6] linear-gradient.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ed8f95c0..a8e6275b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ | 4 | @react-native-community/slider | 4.4.3 | 是 | 90% | [@react-native-oh-library/slider@4.4.3-0.1.1](https://github.com/react-native-oh-library/react-native-slider/releases/tag/4.4.3-0.1.1) | [链接](zh-cn/react-native-slider.md) | | 5 | @react-native-masked-view/masked-view | 0.2.9 | 否 | 90% | [@react-native-oh-library/masked-view@0.2.9-0.0.1](https://github.com/react-native-oh-library/masked-view/releases/tag/0.2.9-0.0.1) | [链接](zh-cn/react-native-masked-view.md) | | 6 | @react-native-community/checkbox | 0.5.16 | 否 | 100% | [@react-native-oh-library/checkbox@0.5.16-0.0.2](https://github.com/react-native-oh-library/react-native-checkbox/releases/tag/0.5.16-0.0.2) | [链接](zh-cn/react-native-checkbox.md) | -| 7 | react-native-linear-gradient | 3.0.0-alpha.1 | 是 | 100% | [@react-native-oh-library/react-native-linear-gradient@3.0.0-alpha.1-0.2.4](https://github.com/react-native-oh-library/react-native-linear-gradient/releases/tag/3.0.0-alpha.1-0.2.4) | [链接](zh-cn/react-native-linear-gradient.md) | +| 7 | react-native-linear-gradient | 3.0.0-alpha.1 | 是 | 90% | [@react-native-oh-library/react-native-linear-gradient@3.0.0-alpha.1-0.2.4](https://github.com/react-native-oh-library/react-native-linear-gradient/releases/tag/3.0.0-alpha.1-0.2.4) | [链接](zh-cn/react-native-linear-gradient.md) | ## 社区 [react-native-oh-library](https://github.com/react-native-oh-library) \ No newline at end of file -- Gitee From a0d667b5f45060ba52a27676a43d1bd3112da133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=BD=B3=E4=BB=8A?= <10284872+wedatahub@user.noreply.gitee.com> Date: Thu, 23 Nov 2023 10:16:35 +0800 Subject: [PATCH 4/6] "changes index" --- index.html | 1 + zh-cn/async-storage.md | 4 ++-- zh-cn/picker.md | 6 +++--- zh-cn/react-native-checkbox.md | 6 +++--- zh-cn/react-native-masked-view.md | 6 +++--- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 32f04315..d7147e12 100644 --- a/index.html +++ b/index.html @@ -28,6 +28,7 @@ themeColor: '#876296', // 项目名称 name: 'RNOH三方库说明文档', + name: 'RNOH三方库说明文档', // 项目图标 // logo: '/img/icon.svg', // 仓库地址,点击右上角的Github章鱼猫头像会跳转到此地址 diff --git a/zh-cn/async-storage.md b/zh-cn/async-storage.md index e3d29c23..ea2ff31a 100644 --- a/zh-cn/async-storage.md +++ b/zh-cn/async-storage.md @@ -109,7 +109,7 @@ cd entry ohpm install --no-link ``` -### 配置 CMakeLists 和引入 SliderPackge +### 配置 CMakeLists 和引入 AsynStoragePackge 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: @@ -157,7 +157,7 @@ std::vector> PackageProvider::getPackages(Package::Cont } ``` -### 在 ArkTs 侧引入 slider 组件 +### 在 ArkTs 侧引入 AsynStorage 组件 打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: diff --git a/zh-cn/picker.md b/zh-cn/picker.md index 56fc9b86..f333cf37 100644 --- a/zh-cn/picker.md +++ b/zh-cn/picker.md @@ -169,19 +169,19 @@ struct Index { @StorageLink('RNAbility') rnAbility: RNAbility | undefined = undefined @Builder - buildCustomComponent(ctx: ComponentBuilderContext) { + function CustomComponentBuilder(ctx: ComponentBuilderContext) { if (ctx.descriptor.type === SAMPLE_VIEW_TYPE) { SampleView({ ctx: ctx.rnohContext, tag: ctx.descriptor.tag, - buildCustomComponent: this.buildCustomComponent.bind(this) + buildCustomComponent: CustomComponentBuilder }) } + else if (ctx.descriptor.type === HARMONY_PICKER_TYPE) { + RNCHarmonyPicker({ + ctx: ctx.rnohContext, + tag: ctx.descriptor.tag, -+ buildCustomComponent: this.buildCustomComponent.bind(this) ++ buildCustomComponent: CustomComponentBuilder + }) + } ... diff --git a/zh-cn/react-native-checkbox.md b/zh-cn/react-native-checkbox.md index 4683b14e..92e29bfe 100644 --- a/zh-cn/react-native-checkbox.md +++ b/zh-cn/react-native-checkbox.md @@ -179,19 +179,19 @@ struct Index { @StorageLink('RNAbility') rnAbility: RNAbility | undefined = undefined @Builder - buildCustomComponent(ctx: ComponentBuilderContext) { + function CustomComponentBuilder(ctx: ComponentBuilderContext) { if (ctx.descriptor.type === SAMPLE_VIEW_TYPE) { SampleView({ ctx: ctx.rnohContext, tag: ctx.descriptor.tag, - buildCustomComponent: this.buildCustomComponent.bind(this) + buildCustomComponent: CustomComponentBuilder }) } + else if (ctx.descriptor.type === CHECKBOX_TYPE) { + RNCCheckbox({ + ctx: ctx.rnohContext, + tag: ctx.descriptor.tag, -+ buildCustomComponent: this.buildCustomComponent.bind(this) ++ buildCustomComponent: CustomComponentBuilder + }) + } ... diff --git a/zh-cn/react-native-masked-view.md b/zh-cn/react-native-masked-view.md index b933f978..68ee5786 100644 --- a/zh-cn/react-native-masked-view.md +++ b/zh-cn/react-native-masked-view.md @@ -192,19 +192,19 @@ struct Index { @StorageLink('RNAbility') rnAbility: RNAbility | undefined = undefined @Builder - buildCustomComponent(ctx: ComponentBuilderContext) { + function CustomComponentBuilder(ctx: ComponentBuilderContext) { if (ctx.descriptor.type === SAMPLE_VIEW_TYPE) { SampleView({ ctx: ctx.rnohContext, tag: ctx.descriptor.tag, - buildCustomComponent: this.buildCustomComponent.bind(this) + buildCustomComponent: CustomComponentBuilder }) } + else if (ctx.descriptor.type === MASKED_VIEW_TYPE) { + MaskedView({ + ctx: ctx.rnohContext, + tag: ctx.descriptor.tag, -+ buildCustomComponent: this.buildCustomComponent.bind(this) ++ buildCustomComponent: CustomComponentBuilder + }) + } ... -- Gitee From 1b7e708ff08c113c5769b92b7e60cc79a3b44fee Mon Sep 17 00:00:00 2001 From: Louis Chan Date: Thu, 23 Nov 2023 03:24:25 +0000 Subject: [PATCH 5/6] =?UTF-8?q?update=20index.html.=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=86=97=E4=BD=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Louis Chan --- index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/index.html b/index.html index d7147e12..32f04315 100644 --- a/index.html +++ b/index.html @@ -28,7 +28,6 @@ themeColor: '#876296', // 项目名称 name: 'RNOH三方库说明文档', - name: 'RNOH三方库说明文档', // 项目图标 // logo: '/img/icon.svg', // 仓库地址,点击右上角的Github章鱼猫头像会跳转到此地址 -- Gitee From 055286ee8c29a531875cf5eb6148985db45e2653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=BD=B3=E4=BB=8A?= <10284872+wedatahub@user.noreply.gitee.com> Date: Thu, 23 Nov 2023 15:04:56 +0800 Subject: [PATCH 6/6] "del Entry" --- index.html | 1 - zh-cn/picker.md | 6 ------ zh-cn/react-native-checkbox.md | 6 ------ zh-cn/react-native-linear-gradient.md | 6 ------ zh-cn/react-native-masked-view.md | 6 ------ 5 files changed, 25 deletions(-) diff --git a/index.html b/index.html index d7147e12..32f04315 100644 --- a/index.html +++ b/index.html @@ -28,7 +28,6 @@ themeColor: '#876296', // 项目名称 name: 'RNOH三方库说明文档', - name: 'RNOH三方库说明文档', // 项目图标 // logo: '/img/icon.svg', // 仓库地址,点击右上角的Github章鱼猫头像会跳转到此地址 diff --git a/zh-cn/picker.md b/zh-cn/picker.md index f333cf37..7e222d94 100644 --- a/zh-cn/picker.md +++ b/zh-cn/picker.md @@ -163,11 +163,6 @@ import { SampleView, SAMPLE_VIEW_TYPE, PropsDisplayer } from "rnoh-sample-packag import { createRNPackages } from '../RNPackagesFactory' + import { RNCHarmonyPicker, HARMONY_PICKER_TYPE } from "rnoh-picker" -@Entry -@Component -struct Index { - @StorageLink('RNAbility') rnAbility: RNAbility | undefined = undefined - @Builder function CustomComponentBuilder(ctx: ComponentBuilderContext) { if (ctx.descriptor.type === SAMPLE_VIEW_TYPE) { @@ -187,7 +182,6 @@ struct Index { ... } ... -} ``` ### 运行 diff --git a/zh-cn/react-native-checkbox.md b/zh-cn/react-native-checkbox.md index 92e29bfe..78661a78 100644 --- a/zh-cn/react-native-checkbox.md +++ b/zh-cn/react-native-checkbox.md @@ -173,11 +173,6 @@ import { SampleView, SAMPLE_VIEW_TYPE, PropsDisplayer } from "rnoh-sample-packag import { createRNPackages } from '../RNPackagesFactory' + import { RNCCheckbox, CHECKBOX_TYPE } from "rnoh-checkbox" -@Entry -@Component -struct Index { - @StorageLink('RNAbility') rnAbility: RNAbility | undefined = undefined - @Builder function CustomComponentBuilder(ctx: ComponentBuilderContext) { if (ctx.descriptor.type === SAMPLE_VIEW_TYPE) { @@ -197,7 +192,6 @@ struct Index { ... } ... -} ``` ### 运行 diff --git a/zh-cn/react-native-linear-gradient.md b/zh-cn/react-native-linear-gradient.md index 0e8811c0..06c81b16 100644 --- a/zh-cn/react-native-linear-gradient.md +++ b/zh-cn/react-native-linear-gradient.md @@ -162,11 +162,6 @@ import { SampleView, SAMPLE_VIEW_TYPE, PropsDisplayer } from "rnoh-sample-packag import { createRNPackages } from '../RNPackagesFactory' + import { RNLinearGradient, LINEAR_GRADIENT_TYPE, LinearGradientDescriptor } from "rnoh-linear-gradient" -@Entry -@Component -struct Index { - @StorageLink('RNAbility') rnAbility: RNAbility | undefined = undefined - @Builder function CustomComponentBuilder(ctx: ComponentBuilderContext) { if (ctx.componentName === SAMPLE_VIEW_TYPE) { @@ -186,7 +181,6 @@ struct Index { ... } ... -} ``` ### 运行 diff --git a/zh-cn/react-native-masked-view.md b/zh-cn/react-native-masked-view.md index 68ee5786..9009a396 100644 --- a/zh-cn/react-native-masked-view.md +++ b/zh-cn/react-native-masked-view.md @@ -186,11 +186,6 @@ import { SampleView, SAMPLE_VIEW_TYPE, PropsDisplayer } from "rnoh-sample-packag import { createRNPackages } from '../RNPackagesFactory' + import { MaskedView, MASKED_VIEW_TYPE } from "rnoh-masked-view" -@Entry -@Component -struct Index { - @StorageLink('RNAbility') rnAbility: RNAbility | undefined = undefined - @Builder function CustomComponentBuilder(ctx: ComponentBuilderContext) { if (ctx.descriptor.type === SAMPLE_VIEW_TYPE) { @@ -210,7 +205,6 @@ struct Index { ... } ... -} ``` ### 运行 -- Gitee