From 773e58e26d257ddaefd53c025d02f5a825b220c4 Mon Sep 17 00:00:00 2001 From: Haoming Luo Date: Wed, 16 Aug 2023 17:14:23 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=BD=BB=E9=87=8F=E7=BA=A7PR=E3=80=91?= =?UTF-8?q?=E5=B0=86=E6=89=80=E6=9C=89=E6=9C=AC=E5=9C=B0=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=9A=84=E5=BA=93=E5=90=8D@ohos/library=E6=94=B9=E4=B8=BAlibra?= =?UTF-8?q?ry=EF=BC=8C=E5=B9=B6=E4=BF=AE=E6=AD=A3=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E5=A4=A7=E6=8B=AC=E5=8F=B7=E4=B8=8D=E5=8C=B9=E9=85=8D=E9=94=99?= =?UTF-8?q?=E8=AF=AF=EF=BC=88=E4=B8=AD=E8=8B=B1=E6=96=87=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haoming Luo --- en/application-dev/quick-start/har-package.md | 6 +++--- en/readme/ai.md | 1 + en/third-party-components/ohpm-third-party-guide.md | 12 ++++++------ zh-cn/application-dev/quick-start/har-package.md | 6 +++--- zh-cn/application-dev/ui/arkts-routing.md | 2 +- ...5\212\241\345\255\220\347\263\273\347\273\237.md" | 1 + .../third-party-components/ohpm-third-party-guide.md | 12 ++++++------ 7 files changed, 21 insertions(+), 19 deletions(-) diff --git a/en/application-dev/quick-start/har-package.md b/en/application-dev/quick-start/har-package.md index 587af49e10..4d54bb1a13 100644 --- a/en/application-dev/quick-start/har-package.md +++ b/en/application-dev/quick-start/har-package.md @@ -98,7 +98,7 @@ To start with, [configure dependency](https://developer.harmonyos.com/cn/docs/do After configuring the dependency on the HAR, you can reference ArkUI components exported from the HAR by using **import**. The sample code is as follows: ```js // entry/src/main/ets/pages/index.ets -import { MainPage } from "@ohos/library" +import { MainPage } from "library" @Entry @Component @@ -123,8 +123,8 @@ struct Index { To reference the TS classes and methods exported from the HAR, use **import** as follows: ```js // entry/src/main/ets/pages/index.ets -import { Log } from "@ohos/library" -import { func } from "@ohos/library" +import { Log } from "library" +import { func } from "library" @Entry @Component diff --git a/en/readme/ai.md b/en/readme/ai.md index 409bfb226e..2c94029665 100644 --- a/en/readme/ai.md +++ b/en/readme/ai.md @@ -183,6 +183,7 @@ The AI subsystem is the part of OpenHarmony that provides native distributed AI * returns a non-zero value otherwise. */ int32_t Destroy(); + } ``` >**Note**: The sequence for the SDK to call client APIs of the AI engine is as follows: AieClientInit -\> AieClientPrepare -\> AieClientSyncProcess/AieClientAsyncProcess -\> AieClientRelease -\> AieClientDestroy. An exception will be thrown if the call sequence is violated. In addition, all these APIs must be called. Otherwise, a memory leakage may occur. diff --git a/en/third-party-components/ohpm-third-party-guide.md b/en/third-party-components/ohpm-third-party-guide.md index 65d872b84f..71956d18c0 100644 --- a/en/third-party-components/ohpm-third-party-guide.md +++ b/en/third-party-components/ohpm-third-party-guide.md @@ -51,7 +51,7 @@ ohpm install ``` "dependencies": { - "@ohos/library": "file:../library" + "library": "file:../library" } ``` @@ -69,12 +69,12 @@ ohpm install ### Referencing an HAR HML Page In a JavaScript project paradigm, component functions are configured in HML files. To reference an HML page in an HAR, first import the page through the **** tag in the HML file of the project. The sample code is as follows: ``` - + ``` -In the preceding example, **@ohos/library** indicates the name of the HAR, and the path of the HML page is the relative path in the HAR. +In the preceding example, **library** indicates the name of the HAR, and the path of the HML page is the relative path in the HAR. You can then reference the HML page based on the set element name. The sample code is as follows: ```typescript - +
@@ -107,7 +107,7 @@ Import the exported ArkTS page in other modules. The following is an example: ```typescript // entry/MainAbility/pages/index.ets -import { MainPage } from "@ohos/library" +import { MainPage } from "library" @Entry @Component struct Index { @@ -136,7 +136,7 @@ export function func() { On other JavaScript/TypeScript pages, use **import** to import the exported methods. The sample code is as follows: ```typescript // entry/src/main/js/MainAbility/pages/index/index.js -import {func} from "@ohos/library" +import {func} from "library" export default { data: { title: "" diff --git a/zh-cn/application-dev/quick-start/har-package.md b/zh-cn/application-dev/quick-start/har-package.md index 299311e92c..cdc5eefe32 100644 --- a/zh-cn/application-dev/quick-start/har-package.md +++ b/zh-cn/application-dev/quick-start/har-package.md @@ -135,7 +135,7 @@ HAR模块编译打包时会把资源打包到HAR中。在编译构建HAP时,De HAR的依赖配置成功后,可以引用HAR的ArkUI组件。ArkUI组件的导入方式与ts的导入方式一致,通过`import`引入HAR导出的ArkUI组件,示例如下所示: ```js // entry/src/main/ets/pages/index.ets -import { MainPage } from "@ohos/library" +import { MainPage } from "library" @Entry @Component @@ -160,8 +160,8 @@ struct Index { 通过`import`引用HAR导出的ts类和方法,示例如下所示: ```js // entry/src/main/ets/pages/index.ets -import { Log } from "@ohos/library" -import { func } from "@ohos/library" +import { Log } from "library" +import { func } from "library" @Entry @Component diff --git a/zh-cn/application-dev/ui/arkts-routing.md b/zh-cn/application-dev/ui/arkts-routing.md index bbb6a5dc90..b4119098de 100644 --- a/zh-cn/application-dev/ui/arkts-routing.md +++ b/zh-cn/application-dev/ui/arkts-routing.md @@ -351,7 +351,7 @@ struct MyComponent { ```ts // entry/src/main/ets/pages/Index.ets import router from '@ohos.router'; -import '@ohos/library/src/main/ets/Index.ets' // 引入共享包library中的命名路由页面 +import 'library/src/main/ets/Index.ets' // 引入共享包library中的命名路由页面 @Entry @Component diff --git "a/zh-cn/readme/AI\344\270\232\345\212\241\345\255\220\347\263\273\347\273\237.md" "b/zh-cn/readme/AI\344\270\232\345\212\241\345\255\220\347\263\273\347\273\237.md" index 6e630d7603..c4a67e8705 100644 --- "a/zh-cn/readme/AI\344\270\232\345\212\241\345\255\220\347\263\273\347\273\237.md" +++ "b/zh-cn/readme/AI\344\270\232\345\212\241\345\255\220\347\263\273\347\273\237.md" @@ -190,6 +190,7 @@ AI业务子系统是OpenHarmony提供原生的分布式AI能力的子系统。 * returns a non-zero value otherwise. */ int32_t Destroy(); + } ``` >**注意**:SDK调用AI引擎客户端接口顺序应遵循AieClientInit-\>AieClientPrepare-\>AieClientSyncProcess/AieClientAsyncProcess-\>AieClientRelease-\>AieClientDestroy,否则调用接口会返回错误码;同时应保证各个接口都有调用到,要不然会引起内存泄漏。 diff --git a/zh-cn/third-party-components/ohpm-third-party-guide.md b/zh-cn/third-party-components/ohpm-third-party-guide.md index 310aaf4dbb..2d74015116 100644 --- a/zh-cn/third-party-components/ohpm-third-party-guide.md +++ b/zh-cn/third-party-components/ohpm-third-party-guide.md @@ -50,7 +50,7 @@ ohpm install ../library - 方式二:在工程的oh-package.json5中设置三方包依赖,配置示例如下: ``` "dependencies": { - "@ohos/library": "file:../library" + "library": "file:../library" } ``` 依赖设置完成后,需要执行ohpm install命令安装依赖包,依赖包会存储在工程的oh_modules目录下。 @@ -69,12 +69,12 @@ ohpm install ### 引用OpenHarmony HAR hml页面 在JS工程范式中,组件功能由hml承载,开发者可以在JS工程的hml页面通过标签来引入OpenHarmony HAR中的共享hml页面,示例如下: ``` - + ``` -其中,@ohos/library为OpenHarmony HAR的包名,hml页面的路径为OpenHarmony HAR中的相对路径。 +其中,library为OpenHarmony HAR的包名,hml页面的路径为OpenHarmony HAR中的相对路径。 随后便可以通过设置的name来使用该element元素,以引用OpenHarmony HAR中的hml页面,示例如下: ```typescript - +
@@ -107,7 +107,7 @@ export struct MainPage { ```typescript // entry/MainAbility/pages/index.ets -import { MainPage } from "@ohos/library" +import { MainPage } from "library" @Entry @Component struct Index { @@ -136,7 +136,7 @@ export function func() { 然后在其它的ts/js页面中,通过import引入导出的ts/js方法,示例如下所示: ```typescript // entry/src/main/js/MainAbility/pages/index/index.js -import {func} from "@ohos/library" +import {func} from "library" export default { data: { title: "" -- GitLab