diff --git a/en/application-dev/quick-start/har-package.md b/en/application-dev/quick-start/har-package.md index 587af49e108ed1cfedbd9a190ea7858bc470073c..4d54bb1a139eb2c42b3feab8fe3f5d20ce5d0b7d 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 409bfb226eab0208354adaf65b6a03bda5a99c69..2c94029665cf163e94917c4cffadf76da1a84970 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 65d872b84fa4a46891861aebea380262b8b4a15b..71956d18c0a0e8313cffb9dcb2784a74aed3b2b4 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 299311e92cb506fdbf81263d4df2306702e9f940..cdc5eefe328f13f8f1005a4d18286f2bdcbb2495 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 bbb6a5dc90628fda1e1b18df4cdfef54f4a8dd5c..b4119098dec6335961abb9ca940bbafc65c82f3e 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 6e630d76030ed738dfdf832664cab12c332f49a3..c4a67e8705e74603553e7a7097e374868e3e0c21 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 310aaf4dbb4f8f99112c77da0501549e65e66de9..2d7401511612e07abc9ded423f39ab7f4668af86 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: ""