Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
006df589
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
006df589
编写于
3月 28, 2022
作者:
H
HelloCrease
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
HelloCrease
<
lian15@huawei.com
>
上级
9191e3a2
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
141 addition
and
130 deletion
+141
-130
zh-cn/application-dev/reference/apis/js-apis-logs.md
zh-cn/application-dev/reference/apis/js-apis-logs.md
+18
-15
zh-cn/application-dev/reference/apis/js-apis-resource-manager.md
...pplication-dev/reference/apis/js-apis-resource-manager.md
+5
-5
zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md
...plication-dev/reference/apis/js-apis-system-mediaquery.md
+24
-22
zh-cn/application-dev/reference/apis/js-apis-system-prompt.md
...n/application-dev/reference/apis/js-apis-system-prompt.md
+40
-37
zh-cn/application-dev/reference/apis/js-apis-system-router.md
...n/application-dev/reference/apis/js-apis-system-router.md
+54
-51
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-logs.md
浏览文件 @
006df589
# 日志打印
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 从API Version 7 开始,该接口不再维护,推荐使用新接口['@ohos.hilog](js-apis-hilog.md)'。
## console.debug
debug(message: string): void
...
...
@@ -8,7 +11,7 @@ debug(message: string): void
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| -------
| ------ | ---- | ---
-------- |
| message | string | 是 | 表示要打印的文本信息。 |
...
...
@@ -20,7 +23,7 @@ log(message: string): void
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| -------
| ------ | ---- | ---
-------- |
| message | string | 是 | 表示要打印的文本信息。 |
...
...
@@ -32,7 +35,7 @@ info(message: string): void
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| -------
| ------ | ---- | ---
-------- |
| message | string | 是 | 表示要打印的文本信息。 |
...
...
@@ -44,7 +47,7 @@ warn(message: string): void
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| -------
| ------ | ---- | ---
-------- |
| message | string | 是 | 表示要打印的文本信息。 |
...
...
@@ -56,7 +59,7 @@ error(message: string): void
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| -------
| ------ | ---- | ---
-------- |
| message | string | 是 | 表示要打印的文本信息。 |
...
...
zh-cn/application-dev/reference/apis/js-apis-resource-manager.md
浏览文件 @
006df589
资源管理
#
资源管理
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
...
...
@@ -672,7 +672,7 @@ getRawFileDescriptor(path: string, callback: AsyncCallback<RawFileDescriptor&
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------------
-------------------- | ---- | ---------------
-------------------------------- |
| -------- | ----------------------------------------
| ---- |
-------------------------------- |
| path | string | 是 | rawfile文件路径 |
| callback | AsyncCallback
<
[RawFileDescriptor](#rawfiledescriptor8)
>
| 是 | 异步回调,用于返回获取的rawfile文件的descriptor |
...
...
zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md
浏览文件 @
006df589
...
...
@@ -2,7 +2,9 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
> - 从API Version 7 开始,该接口不再维护,推荐使用新接口['@ohos.mediaquery](js-apis-mediaquery.md)'。
> - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
...
...
@@ -24,13 +26,13 @@ matchMedia(condition: string): MediaQueryList
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| --------
| -------- | ----
---- | -------- |
| --------
- | ------ |
---- | -------- |
| condition | string | 是 | 用于查询的条件。 |
**返回值:**
| 参数类型 | 说明 |
| --------
|
-------- |
| --------
------ | --------------------------------
-------- |
| MediaQueryList | 表示创建MediaQueryList对象的属性,详情见下表 MediaQueryList说明。 |
**示例:**
...
...
@@ -50,7 +52,7 @@ export default {
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------
- | -------- | -------- | ---
----- |
| -------
| ------- | ---- |
----- |
| matches | boolean | 是 | 匹配结果。 |
## MediaQueryList
...
...
@@ -62,7 +64,7 @@ export default {
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| -------
| ------- | ---- | ---------
-------- |
| media | string | 否 | 序列化媒体查询条件,该参数为只读。 |
| matches | boolean | 是 | 匹配结果。 |
...
...
@@ -77,7 +79,7 @@ matches状态变化时的执行函数。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| -------
| ------- | ---- | ------
-------- |
| matches | boolean | 是 | matches状态变化时值。 |
...
...
@@ -92,7 +94,7 @@ addListener(callback: (event: MediaQueryEvent) => void): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------
| -------- |
-------- |
| -------- | --------
------------------------ | ---- | ------
-------- |
| callback | (event: MediaQueryEvent) => void | 是 | 匹配条件发生变化的响应函数。 |
**示例:**
...
...
@@ -113,7 +115,7 @@ removeListener(callback: (event: MediaQueryEvent) => void): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------
| -------- |
-------- |
| -------- | --------
------------------------- | ---- | ------
-------- |
| callback | (event: MediaQueryEvent) => void) | 是 | 匹配条件发生变化的响应函数。 |
**示例:**
...
...
zh-cn/application-dev/reference/apis/js-apis-system-prompt.md
浏览文件 @
006df589
# 弹窗
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
>
- 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
> - 从API Version 8 开始,该接口不再维护,推荐使用新接口['@ohos.prompt](js-apis-prompt.md)'。
>
>
> - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
...
...
@@ -23,7 +26,7 @@ showToast(options: ShowToastOptions): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| -------
| ------------------------------------- | ---- | -------
-------- |
| options |
[
ShowToastOptions
](
#showtoastoptions
)
| 是 | 定义ShowToast的选项。 |
**示例:**
...
...
@@ -51,8 +54,8 @@ showDialog(options: ShowDialogOptions): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| options |
[
ShowDialogOptions
](
#showdialogoptions
)
| 是
| 定义显示对话框的选项。
|
| -------
| --------------------------------------- | ---- | ---
-------- |
| options |
[
ShowDialogOptions
](
#showdialogoptions
)
| 是
| 定义显示对话框的选项。
|
**示例:**
...
...
@@ -91,7 +94,7 @@ showActionMenu(options: ShowActionMenuOptions): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| -------
| ---------------------------------------- | ---- | ------------
-------- |
| options |
[
ShowActionMenuOptions
](
#showactionmenuoptions
)
| 是 | 定义ShowActionMenu的选项。 |
...
...
@@ -129,10 +132,10 @@ export default {
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| --------
| -------- | -------- |
-------- |
| --------
----------- | -------------- | ---- | --------------------------------
-------- |
| message | string | 是 | 显示的文本信息。 |
| duration | number | 否 | 默认值1500ms,建议区间:1500ms-10000ms。若小于1500ms则取默认值,最大取值为10000ms。 |
| bottom
<sup>
5+
</sup>
| string
\|
number
| 否 | 设置弹窗边框距离屏幕底部的位置,仅手机和平板设备支持。
|
| bottom
<sup>
5+
</sup>
| string
\|
number
| 否 | 设置弹窗边框距离屏幕底部的位置,仅手机和平板设备支持。
|
## Button
...
...
@@ -141,7 +144,7 @@ export default {
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -----
--- | -------- | -------- | -
------- |
| -----
| ------ | ---- |
------- |
| text | string | 是 | 定义按钮信息。 |
| color | string | 是 | 定义按钮颜色。 |
...
...
@@ -152,7 +155,7 @@ export default {
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -----
--- | -------- | -------- |
-------- |
| -----
| ------ | ---- | --
-------- |
| index | number | 是 | 定义数据的索引信息。 |
## ShowDialogOptions
...
...
@@ -162,7 +165,7 @@ export default {
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | --------
| -------- |
-------- |
| -------- | --------
-------------------------------- | ---- | --------------------------------
-------- |
| title | string | 否 | 标题文本。 |
| message | string | 否 | 文本内容。 |
| buttons |
[
[Button
](
#button
)
,
[
Button
](
#button
)
?,
[
Button
](
#button
)
?] | 否 | 对话框中按钮的数组,结构为:{text:'button', color: '
\#
666666'},支持1-6个按钮。大于6个按钮时弹窗不显示。 |
...
...
@@ -177,9 +180,9 @@ export default {
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | --------
| -------- |
-------- |
| -------- | --------
-------------------------------- | ---- | --------------------------------
-------- |
| title | string | 否 | 标题文本。 |
| buttons
|
[
[Button
](
#button
)
,
[
Button
](
#button
)
?,
[
Button
](
#button
)
?,
[
Button
](
#button
)
?,
[
Button
](
#button
)
?,
[
Button
](
#button
)
?] | 是 | 对话框中按钮的数组,结构为:{text:'button', color: '
\#
666666'},支持1-6个按钮。
|
| buttons
|
[
[Button
](
#button
)
,
[
Button
](
#button
)
?,
[
Button
](
#button
)
?,
[
Button
](
#button
)
?,
[
Button
](
#button
)
?,
[
Button
](
#button
)
?] | 是 | 对话框中按钮的数组,结构为:{text:'button', color: '
\#
666666'},支持1-6个按钮。
|
| success | (tapIndex: number, errMsg: string) => void | 否 | 弹出对话框时调用。 |
| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数。 |
| complete | (data: string) => void | 否 | 关闭对话框时调用。 |
zh-cn/application-dev/reference/apis/js-apis-system-router.md
浏览文件 @
006df589
# 页面路由
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
>
- 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
> - 从API Version 8 开始,该接口不再维护,推荐使用新接口['@ohos.router'](js-apis-router.md)。
>
>
> - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
...
...
@@ -23,8 +26,8 @@ push(options: RouterOptions): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| options |
[
RouterOptions
](
#routeroptions
)
| 是
| 页面路由参数,详细请参考RouterOptions。
|
| -------
| ------------------------------- | ---- | ------------------
-------- |
| options |
[
RouterOptions
](
#routeroptions
)
| 是
| 页面路由参数,详细请参考RouterOptions。
|
**示例:**
...
...
@@ -77,8 +80,8 @@ replace(options: RouterOptions): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| options |
[
RouterOptions
](
#routeroptions
)
| 是
| 页面路由参数,详细请参考RouterOptions。
|
| -------
| ------------------------------- | ---- | ------------------
-------- |
| options |
[
RouterOptions
](
#routeroptions
)
| 是
| 页面路由参数,详细请参考RouterOptions。
|
**示例:**
...
...
@@ -120,8 +123,8 @@ back(options?: BackRouterOptions): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| options |
[
BackRouterOptions
](
#backrouteroptions
)
| 是
| 详细请参考BackRouterOptions。
|
| -------
| --------------------------------------- | ---- | ---------------
-------- |
| options |
[
BackRouterOptions
](
#backrouteroptions
)
| 是
| 详细请参考BackRouterOptions。
|
**示例:**
...
...
@@ -192,8 +195,8 @@ getParams(): ParamsInterface
**返回值:**
| 类型 | 说明 |
| --------
|
-------- |
|
[
ParamsInterface
](
#paramsinterface
)
| 详细请参见ParamsInterface。|
| --------
--------------------------- | -------------
-------- |
|
[
ParamsInterface
](
#paramsinterface
)
| 详细请参见ParamsInterface。
|
## router.clear
...
...
@@ -224,7 +227,7 @@ getLength(): string
**返回值:**
| 类型 | 说明 |
| ------
-- |
-------- |
| ------
| ----------
-------- |
| string | 页面数量,页面栈支持最大数值是32。 |
**示例:**
...
...
@@ -249,8 +252,8 @@ getState(): RouterState
**返回值:**
| 参数类型 | 说明 |
| --------
|
-------- |
|
[
RouterState
](
#routerstate
)
| 详细请参见RouterState。|
| --------
------------------- | ---------
-------- |
|
[
RouterState
](
#routerstate
)
| 详细请参见RouterState。
|
**示例:**
...
...
@@ -276,7 +279,7 @@ enableAlertBeforeBackPage(options: EnableAlertBeforeBackPageOptions): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| -------
| ---------------------------------------- | ---- | ------------------------------
-------- |
| options |
[
EnableAlertBeforeBackPageOptions
](
#enableAlertbeforebackpageoptions6
)
| 是 | 详细请参见EnableAlertBeforeBackPageOptions。 |
**示例:**
...
...
@@ -308,7 +311,7 @@ disableAlertBeforeBackPage(options?: DisableAlertBeforeBackPageOptions): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- |
-------- |
| -------
| ---------------------------------------- | ---- | -------------------------------
-------- |
| options |
[
DisableAlertBeforeBackPageOptions
](
#disablealertbeforebackpageoptions6
)
| 否 | 详细请参见DisableAlertBeforeBackPageOptions。 |
**示例:**
...
...
@@ -335,7 +338,7 @@ export default {
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Lite
| 名称 | 参数类型 | 必填 | 说明 |
| ------
-- | -------- | -------- |
-------- |
| ------
| ------ | ---- | --------------------------------
-------- |
| uri | string | 是 | 目标页面的uri,可以是以下的两种格式:
<br/>
1. 页面的绝对路径,由config.json文件中的页面列表提供。例如:
<br/>
- pages/index/index
<br/>
-pages/detail/detail
<br/>
2. 特定路径。如果URI为斜杠(/),则显示主页。 |
| params | Object | 否 | 跳转时要同时传递到目标页面的数据,跳转到目标页面后,参数可以在页面中直接使用,如this.data1(data1为跳转时params参数中的key值)。如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 |
...
...
@@ -347,9 +350,9 @@ export default {
**系统能力:**
以下各项对应的系统能力有所不同,详见下表。
| 名称 | 参数类型 | 必填 | 说明 |
| ------
-- | -------- | -------- |
-------- |
| uri
| string | 否 | 返回到指定uri的界面,如果页面栈上没有uri页面,则不响应该情况。如果uri未设置,则返回上一页。
<br>
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
|
| params | Object | 否
| 跳转时要同时传递到目标页面的数据。
<br>
**系统能力:**
SystemCapability.ArkUI.ArkUI.Lite
|
| ------
| ------ | ---- | --------------------------------
-------- |
| uri
| string | 否 | 返回到指定uri的界面,如果页面栈上没有uri页面,则不响应该情况。如果uri未设置,则返回上一页。
<br>
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
|
| params | Object | 否
| 跳转时要同时传递到目标页面的数据。
<br>
**系统能力:**
SystemCapability.ArkUI.ArkUI.Lite
|
## RouterState
...
...
@@ -358,7 +361,7 @@ export default {
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -----
--- | -------- | -------- |
-------- |
| -----
| ------ | ---- | --------------------------
-------- |
| index | number | 是 | 表示当前页面在页面栈中的索引。从栈底到栈顶,index从1开始递增。 |
| name | string | 是 | 表示当前页面的名称,即对应文件名。 |
| path | string | 是 | 表示当前页面的路径。 |
...
...
@@ -370,7 +373,7 @@ export default {
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | --------
| -------- |
-------- |
| -------- | --------
---------------- | ---- | -----------------
-------- |
| message | string | 是 | 询问对话框内容。 |
| success | (errMsg: string) => void | 否 | 弹出对话框时调用,errMsg表示返回信息。 |
| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数,errMsg表示返回信息。 |
...
...
@@ -383,13 +386,13 @@ export default {
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | --------
| -------- |
-------- |
| -------- | --------
---------------- | ---- | -----------------
-------- |
| success | (errMsg: string) => void | 否 | 弹出对话框时调用,errMsg表示返回信息。 |
| fail
| (errMsg: string) => void | 否 | 接口调用失败的回调函数,errMsg表示返回信息。
|
| fail
| (errMsg: string) => void | 否 | 接口调用失败的回调函数,errMsg表示返回信息。
|
| complete | () => void | 否 | 接口调用结束的回调函数。 |
## ParamsInterface
| 名称 | 参数类型 | 说明 |
| --------
| -------- | -
------- |
| [key: string] | Object| 路由参数列表。 |
| --------
----- | ------ |
------- |
| [key: string] | Object
| 路由参数列表。 |
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录