未验证 提交 190e9721 编写于 作者: O openharmony_ci 提交者: Gitee

!12021 规范修改,无需翻译

Merge pull request !12021 from zengyawen/master
......@@ -64,7 +64,7 @@ For details about the result codes, see [Event Verification Result Codes](#event
The following uses a one-time event watcher as an example to illustrate the development procedure.
1. Create an eTS application project. In the displayed **Project** window, choose **entry** > **src** > **main** > **ets** > **pages** > **index.ets**, and double-click **index.ets**. Then, add three buttons to simulate the process of watching for application events. Wherein, button 1 is used to invoke application event logging, button 2 to add an event watcher that automatically triggers a callback, and button 3 to remove the watcher. The complete sample code is as follows:
1. Create an ArkTS application project. In the displayed **Project** window, choose **entry** > **src** > **main** > **ets** > **pages** > **index.ets**, and double-click **index.ets**. Then, add three buttons to simulate the process of watching for application events. Wherein, button 1 is used to invoke application event logging, button 2 to add an event watcher that automatically triggers a callback, and button 3 to remove the watcher. The complete sample code is as follows:
```ts
import hiAppEvent from '@ohos.hiAppEvent';
......
# ArkUI (eTS) Development
# ArkUI (ArkTS) Development
......@@ -72,7 +72,7 @@ Applicable to: OpenHarmony SDK 3.2.2.5, stage model of API version 9
2. Convert data in Uint8Array format to the string type by calling the **String.fromCharCode** API.
Reference: [Resource Management](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-resource-manager.md)
Reference: [Resource Management](../reference/apis/js-apis-resource-manager.md)
Example:
......@@ -94,7 +94,7 @@ Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
Use the **resourceManager.getString()** API of the **\@ohos.resourceManager** module.
Reference: [Resource Management](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-resource-manager.md#getstring)
Reference: [Resource Management](../reference/apis/js-apis-resource-manager.md#getstring)
## What should I do if the global static variables of a class do not work?
......@@ -102,8 +102,6 @@ Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
Objects imported to abilities and pages are packaged into two different closures, that is, two global objects. In this case, a static variable referenced by the abilities is not the same object as that referenced by the pages. Therefore, global variables cannot be defined by defining static variables in the class. You are advised to use AppStorage to manage global variables.
Reference: [AppStorage](https://docs.openharmony.cn/pages/v3.2Beta/en/application-dev/ui/ts-application-states-appstorage.md/)
## How do I obtain resources in the stage model?
Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
......@@ -154,9 +152,9 @@ build() {
Applicable to: OpenHarmony SDK 3.2.2.5, stage model of API version 9
No. Currently, **CustomDialog** can be used only on eTS pages.
No. Currently, **CustomDialog** can be used only on ArkTS pages.
Reference: [Custom Dialog Box](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md)
Reference: [Custom Dialog Box](../reference/arkui-ts/ts-methods-custom-dialog-box.md)
## How do I transfer variables in CustomDialog to variables on pages?
......@@ -210,7 +208,7 @@ Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
By default, child components in a **\<GridContainer>** are horizontally aligned to the left. To center them, perform the following steps:
Nest a **\<Row>** component and set it to **justifyContent(FlexAlign.Center)**. For details, see [Grid Layout](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/ui-ts-layout-grid-container.md).
Nest a **\<Row>** component and set it to **justifyContent(FlexAlign.Center)**. For details, see [Grid Layout](../reference/arkui-ts/ts-container-gridcontainer.md).
Example:
......@@ -267,13 +265,13 @@ export default class MainAbility extends Ability {
}
```
## How do I execute JavaScript functions in the \<Web> component in eTS code?
## How do I execute JavaScript functions in the \<Web> component in ArkTS code?
Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
Call the **runJavaScript** API in the **WebController** to asynchronously execute JavaScript scripts. This API uses a callback to return the execution result. Note: **runJavaScript** can only be called after **loadUrl** has been completed. For example, it can be called in **onPageEnd**.
Reference: [Web](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/arkui-ts/ts-basic-components-web.md)
Reference: [Web](../reference/arkui-ts/ts-basic-components-web.md)
## How do I fix misidentification of the pan gesture where container nesting is involved?
......
......@@ -53,5 +53,5 @@ The following description is provided for each API in the reference document to
OpenHarmony supports two development languages: JS and TS.
- When a code block is labeled with `js`, the sample code can be used in the JS and eTS projects.
- When a code block is labeled with `ts`, the sample code can be used only in the eTS project.
- When a code block is labeled with `js`, the sample code can be used in the JS and ArkTS projects.
- When a code block is labeled with `ts`, the sample code can be used only in the ArkTS project.
......@@ -63,7 +63,7 @@ async function readFile(path) {
适用于:OpenHarmony SDK 3.2.5.3版本,API9 Stage模型
getAlbums方法需要权限:ohos.permission.READ_MEDIA,从[OpenHarmony权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)查询知道ohos.permission.READ_MEDIA权限是需要用户授权。
getAlbums方法需要权限:ohos.permission.READ_MEDIA,从[OpenHarmony权限定义列表](../security/permission-list.md)查询知道ohos.permission.READ_MEDIA权限是需要用户授权。
1. 在module.json5中配置权限:
......
......@@ -53,5 +53,5 @@ APL等级的详细说明及如何将应用的APL等级声明为normal以上,
OpenHarmony支持使用JS和TS两种开发语言。
- 当代码块标注`js`时,示例代码可在JS和eTS工程中使用。
- 当代码块标注`ts`时,示例代码仅可在eTS工程中使用。
\ No newline at end of file
- 当代码块标注`js`时,示例代码可在JS和ArkTS工程中使用。
- 当代码块标注`ts`时,示例代码仅可在ArkTS工程中使用。
......@@ -195,7 +195,7 @@ set(key: string, value: string, callback: AsyncCallback&lt;void&gt;): void
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> - 此接口只能用于系统应用的参数设置。
> - 所授权的系统应用需要配置对应selinux和dac规则,具体配置方法请参照系统参数指导文档:[系统参数](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/subsystems/subsys-boot-init-sysparam.md)。
> - 所授权的系统应用需要配置对应selinux和dac规则,具体配置方法请参照系统参数指导文档:[系统参数](../../../device-dev/subsystems/subsys-boot-init-sysparam.md)。
**示例:**
......@@ -235,7 +235,7 @@ set(key: string, value: string): Promise&lt;void&gt;
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> - 此接口只能用于系统应用的参数设置。
> - 所授权的系统应用需要配置对应selinux和dac规则,具体配置方法请参照系统参数指导文档:[系统参数](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/subsystems/subsys-boot-init-sysparam.md)
> - 所授权的系统应用需要配置对应selinux和dac规则,具体配置方法请参照系统参数指导文档:[系统参数](../../../device-dev/subsystems/subsys-boot-init-sysparam.md)
**示例:**
......
......@@ -172,7 +172,7 @@
## user_grant权限预授权
当前正常情况下,user_grant类型的权限默认不授权,需要时应通过拉起弹框由用户确认是否授予。对于一些预置应用,比如截屏应用,不希望出现弹框,则可以通过预授权的方式完成user_grant类型权限的授权。[预置配置文件](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list_permissions.json)在设备上的路径为system/etc/app/install_list_permission.json,设备开机启动时会读取该配置文件,在应用安装会对在文件中配置的user_grant类型权限授权。当前仅支持预置应用配置该文件。
预授权配置文件字段内容包括bundleName、app_signature、permissions。
1. 这里的权限仅对user_grant类型的权限生效[查看权限等级和类型](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)
1. 这里的权限仅对user_grant类型的权限生效[查看权限等级和类型](permission-list.md)
2. userCancellable配置为true,表示支持用户取消授权,为false则表示不支持用户取消授权。
```json
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册