未验证 提交 78b54dc1 编写于 作者: O openharmony_ci 提交者: Gitee

!3984 sample变更修改

Merge pull request !3984 from LiAn/OpenHarmony-3.1-Release
...@@ -4,32 +4,20 @@ ...@@ -4,32 +4,20 @@
应用或业务模块处于后台(无可见界面)时,如果有需要继续执行或者后续执行的业务,可基于业务类型,申请短时任务延迟挂起(Suspend)或者长时任务避免进入挂起状态。 应用或业务模块处于后台(无可见界面)时,如果有需要继续执行或者后续执行的业务,可基于业务类型,申请短时任务延迟挂起(Suspend)或者长时任务避免进入挂起状态。
## 接口说明
```js
import backgroundTaskManager from '@ohos.backgroundTaskManager';
```
## 短时任务 ## 短时任务
### 接口说明
**表1** 短时任务主要接口 **表1** 短时任务主要接口
| 接口名 | 描述 | | 接口名 | 描述 |
| -------- | -------- | | -------- | -------- |
| function&nbsp;requestSuspendDelay(reason:&nbsp;string,&nbsp;callback:&nbsp;Callback&lt;void&gt;):&nbsp;**DelaySuspendInfo**; | 后台应用申请延迟挂起。<br/>延迟挂起时间一般情况下默认值为180000,低电量(依据系统低电量广播)时默认值为60000。 | | requestSuspendDelay(reason:&nbsp;string,&nbsp;callback:&nbsp;Callback&lt;void&gt;):&nbsp;[DelaySuspendInfo](../reference/apis/js-apis-backgroundTaskManager.md#delaysuspendinfo) | 后台应用申请延迟挂起。<br/>延迟挂起时间一般情况下默认值为180000,低电量时默认值为60000。 |
| function&nbsp;getRemainingDelayTime(requestId:&nbsp;number,&nbsp;callback:&nbsp;AsyncCallback&lt;number&gt;):&nbsp;void;<br/>function&nbsp;getRemainingDelayTime(requestId:&nbsp;number):&nbsp;Promise&lt;number&gt;; | 获取应用程序进入挂起状态前的剩余时间。(requestId从requestSuspendDelay的返回值获取)<br/>提供两种异步方法,使用Callback形式其任务执行结果以参数形式提供给回调函数,Promise形式则返回一个Promise对象。 | | getRemainingDelayTime(requestId:&nbsp;number):&nbsp;Promise&lt;number&gt; | 获取应用程序进入挂起状态前的剩余时间。<br/>其任务执行结果以Promise形式返回给应用。 |
| function&nbsp;cancelSuspendDelay(requestId:&nbsp;number):&nbsp;void; | 取消延迟挂起。(requestId从requestSuspendDelay的返回值获取) | | cancelSuspendDelay(requestId:&nbsp;number):&nbsp;void | 取消延迟挂起。 |
**表2** DelaySuspendInfo包含参数
| 参数名 | 类型 | 是否必选 | 描述 |
| -------- | -------- | -------- | -------- |
| requestId | number | 是 | 延迟挂起的请求ID。 |
| actualDelayTime | number | 是 | 应用的实际挂起延迟时间,以毫秒为单位。 |
## 开发步骤 ### 开发步骤
1. 申请延迟挂起 1. 申请延迟挂起
...@@ -65,7 +53,7 @@ import backgroundTaskManager from '@ohos.backgroundTaskManager'; ...@@ -65,7 +53,7 @@ import backgroundTaskManager from '@ohos.backgroundTaskManager';
``` ```
## 开发实例 ### 开发实例
```js ```js
import backgroundTaskManager from '@ohos.backgroundTaskManager'; import backgroundTaskManager from '@ohos.backgroundTaskManager';
...@@ -99,17 +87,19 @@ backgroundTaskManager.cancelSuspendDelay(id); ...@@ -99,17 +87,19 @@ backgroundTaskManager.cancelSuspendDelay(id);
ohos.permission.KEEP_BACKGROUND_RUNNING ohos.permission.KEEP_BACKGROUND_RUNNING
**表3** 长时任务主要接口 ### 接口说明
**表2** 长时任务主要接口
| 接口名 | 描述 | | 接口名 | 描述 |
| -------- | -------- | | -------- | -------- |
| function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback&lt;void&gt;): void;<br/>function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise&lt;void&gt;; | 服务启动后,向系统申请长时任务,使服务一直保持后台运行 | | startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise&lt;void&gt; | 服务启动后,向系统申请长时任务,使服务一直保持后台运行。 |
| function stopBackgroundRunning(context: Context, callback: AsyncCallback&lt;void&gt;): void;<br/>function stopBackgroundRunning(context: Context): Promise&lt;void&gt;; | 停止后台长时任务的运行 | | stopBackgroundRunning(context: Context): Promise&lt;void&gt; | 停止后台长时任务的运行。 |
其中,wantAgent的信息详见([WantAgent](../reference/apis/js-apis-wantAgent.md) 其中,wantAgent的信息详见([WantAgent](../reference/apis/js-apis-wantAgent.md)
**表4** 后台模式类型 **表3** 后台模式类型
| 参数名 | id值 | 描述 | 配置项 | | 参数名 | id值 | 描述 | 配置项 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
...@@ -124,34 +114,25 @@ ohos.permission.KEEP_BACKGROUND_RUNNING ...@@ -124,34 +114,25 @@ ohos.permission.KEEP_BACKGROUND_RUNNING
| TASK_KEEPING | 9 | 计算任务(仅供特定设备使用) | taskKeeping | | TASK_KEEPING | 9 | 计算任务(仅供特定设备使用) | taskKeeping |
## 开发步骤 ### 开发步骤
1. 新建Api Version 8的工程后,在工程目录中右键选择“new” -> “Ability” -> “Service Ability” 快速创建Service Ability组件。并在config.json文件中配置长时任务权限、后台模式类型,其中Ability类型为“service”。 1. 新建Api Version 8的工程后,在工程目录中右键选择“new” -> “Ability” -> “Service Ability” 快速创建Service Ability组件。并在config.json文件中配置长时任务权限、后台模式类型,其中Ability类型为“service”。
``` ```
"module": { "module": {
"package": "com.example.myapplication", "package": "com.example.myapplication",
"abilities": [ "abilities": [
{ {
"backgroundModes": [ "backgroundModes": [
"dataTransfer", "dataTransfer",
"location", "location"
], // 后台模式类型
], "type": "service" // ability类型为service
"type": "service"
}
],
"defPermissions": [
{
"name": "ohos.permission.KEEP_BACKGROUND_RUNNING"
} }
], ],
"reqPermissions": [ "reqPermissions": [
{ {
"name": "ohos.permission.KEEP_BACKGROUND_RUNNING" "name": "ohos.permission.KEEP_BACKGROUND_RUNNING" // 长时任务权限
} }
] ]
} }
...@@ -201,13 +182,11 @@ ohos.permission.KEEP_BACKGROUND_RUNNING ...@@ -201,13 +182,11 @@ ohos.permission.KEEP_BACKGROUND_RUNNING
``` ```
## 开发实例 ### 开发实例
基于FA的Service Ability使用,参考[ServiceAbility开发指导](../ability/fa-serviceability.md) 基于FA的Service Ability使用,参考[ServiceAbility开发指导](../ability/fa-serviceability.md)
当不需要与后台执行的长时任务交互时,可以采用startAbility()方法启动Service Ability。并在Service Ability的onStart回调方法中,调用长时任务的申请接口,声明此服务需要在后台长时运行。当任务执行完,再调用长时任务取消接口,及时释放资源。 当不需要与后台执行的长时任务交互时,可以采用startAbility()方法启动Service Ability。并在Service Ability的onStart回调方法中,调用长时任务的申请接口,声明此服务需要在后台长时运行。当任务执行完,再调用长时任务取消接口,及时释放资源。
当服务启动后,在serviceAbility的onStart回调方法中,调用长时任务的申请接口,声明此服务需要在后台长时运行。在onStop回调方法里,调用长时任务取消接口,声明取消长时任务。
当需要与后台执行的长时任务交互时(如播放音乐等)。可以采用connectAbility()方法启动并连接Service Ability。在获取到服务的代理对象后,与服务进行通信,控制长时任务的申请和取消。 当需要与后台执行的长时任务交互时(如播放音乐等)。可以采用connectAbility()方法启动并连接Service Ability。在获取到服务的代理对象后,与服务进行通信,控制长时任务的申请和取消。
```js ```js
...@@ -289,7 +268,6 @@ export default { ...@@ -289,7 +268,6 @@ export default {
}, },
onStop() { onStop() {
console.info('ServiceAbility onStop'); console.info('ServiceAbility onStop');
stopBackgroundRunning();
}, },
onConnect(want) { onConnect(want) {
console.info('ServiceAbility onConnect'); console.info('ServiceAbility onConnect');
...@@ -306,3 +284,9 @@ export default { ...@@ -306,3 +284,9 @@ export default {
} }
}; };
``` ```
## 相关实例
基于后台任务管理,有以下相关实例可供参考:
- [`BackgroundTaskManager`:后台任务管理(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ResourcesSchedule/BackgroundTaskManager)
\ No newline at end of file
...@@ -11,7 +11,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 ...@@ -11,7 +11,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方
### 接口说明 ### 接口说明
| 模块 | 接口名称 | 描述 | | 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- | | --------- | ---------------------------------------- | -------------------------- |
| ohos.intl | constructor()<sup>8+</sup> | 实例化Locale对象。 | | ohos.intl | constructor()<sup>8+</sup> | 实例化Locale对象。 |
| ohos.intl | constructor(locale:&nbsp;string,&nbsp;options?:&nbsp;LocaleOptions) | 基于locale参数及其选项实例化Locale对象。 | | ohos.intl | constructor(locale:&nbsp;string,&nbsp;options?:&nbsp;LocaleOptions) | 基于locale参数及其选项实例化Locale对象。 |
| ohos.intl | toString():&nbsp;string | 将Locale信息转换为字符串。 | | ohos.intl | toString():&nbsp;string | 将Locale信息转换为字符串。 |
...@@ -61,7 +61,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 ...@@ -61,7 +61,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方
### 接口说明 ### 接口说明
| 模块 | 接口名称 | 描述 | | 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- | | --------- | ---------------------------------------- | ---------------------------------------- |
| ohos.intl | constructor()<sup>8+</sup> | 创建日期时间格式化对象。 | | ohos.intl | constructor()<sup>8+</sup> | 创建日期时间格式化对象。 |
| ohos.intl | constructor(locale:&nbsp;string&nbsp;\|&nbsp;Array&lt;string&gt;,&nbsp;options?:&nbsp;DateTimeOptions) | 创建日期时间格式化对象,并设置提供的Locale和格式化相关属性。 | | ohos.intl | constructor(locale:&nbsp;string&nbsp;\|&nbsp;Array&lt;string&gt;,&nbsp;options?:&nbsp;DateTimeOptions) | 创建日期时间格式化对象,并设置提供的Locale和格式化相关属性。 |
| ohos.intl | format(date:&nbsp;Date):&nbsp;string | 依据DateTimeFormat对象的Locale及其他格式化属性,计算日期时间的格式化表示。 | | ohos.intl | format(date:&nbsp;Date):&nbsp;string | 依据DateTimeFormat对象的Locale及其他格式化属性,计算日期时间的格式化表示。 |
...@@ -119,7 +119,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 ...@@ -119,7 +119,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方
### 接口说明 ### 接口说明
| 模块 | 接口名称 | 描述 | | 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- | | --------- | ---------------------------------------- | ---------------------------------------- |
| ohos.intl | constructor()<SUP>8+</SUP> | 创建数字格式化对象。 | | ohos.intl | constructor()<SUP>8+</SUP> | 创建数字格式化对象。 |
| ohos.intl | constructor(locale:&nbsp;string&nbsp;\|&nbsp;Array&lt;string&gt;,&nbsp;options?:&nbsp;NumberOptions) | 创建数字格式化对象,并设置提供的locale和格式化相关属性。 | | ohos.intl | constructor(locale:&nbsp;string&nbsp;\|&nbsp;Array&lt;string&gt;,&nbsp;options?:&nbsp;NumberOptions) | 创建数字格式化对象,并设置提供的locale和格式化相关属性。 |
| ohos.intl | format(number:&nbsp;number):&nbsp;string | 依据NumberFormat对象的Locale及其他格式化属性,计算数字的格式化表示。 | | ohos.intl | format(number:&nbsp;number):&nbsp;string | 依据NumberFormat对象的Locale及其他格式化属性,计算数字的格式化表示。 |
...@@ -167,7 +167,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 ...@@ -167,7 +167,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方
### 接口说明 ### 接口说明
| 模块 | 接口名称 | 描述 | | 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- | | --------- | ---------------------------------------- | ------------------------------- |
| ohos.intl | constructor()<sup>8+</sup> | 创建排序对象。 | | ohos.intl | constructor()<sup>8+</sup> | 创建排序对象。 |
| ohos.intl | constructor(locale:&nbsp;string&nbsp;\|&nbsp;Array&lt;string&gt;,&nbsp;options?:&nbsp;CollatorOptions)<sup>8+</sup> | 创建排序对象,并设置提供的locale和其他相关属性。 | | ohos.intl | constructor(locale:&nbsp;string&nbsp;\|&nbsp;Array&lt;string&gt;,&nbsp;options?:&nbsp;CollatorOptions)<sup>8+</sup> | 创建排序对象,并设置提供的locale和其他相关属性。 |
| ohos.intl | compare(first:&nbsp;string,&nbsp;second:&nbsp;string):&nbsp;number<sup>8+</sup> | 依据排序对象的Locale及其属性,计算两个字符串的比较结果。 | | ohos.intl | compare(first:&nbsp;string,&nbsp;second:&nbsp;string):&nbsp;number<sup>8+</sup> | 依据排序对象的Locale及其属性,计算两个字符串的比较结果。 |
...@@ -215,7 +215,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 ...@@ -215,7 +215,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方
### 接口说明 ### 接口说明
| 模块 | 接口名称 | 描述 | | 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- | | --------- | ---------------------------------------- | ---------------------------------- |
| ohos.intl | constructor()<sup>8+</sup> | 创建单复数对象。 | | ohos.intl | constructor()<sup>8+</sup> | 创建单复数对象。 |
| ohos.intl | constructor(locale:&nbsp;string&nbsp;\|&nbsp;Array&lt;string&gt;,&nbsp;options?:&nbsp;PluralRulesOptions)<sup>8+</sup> | 创建单复数对象,并设置提供的locale和其他相关属性。 | | ohos.intl | constructor(locale:&nbsp;string&nbsp;\|&nbsp;Array&lt;string&gt;,&nbsp;options?:&nbsp;PluralRulesOptions)<sup>8+</sup> | 创建单复数对象,并设置提供的locale和其他相关属性。 |
| ohos.intl | select(n:&nbsp;number):&nbsp;string<sup>8+</sup> | 依据单复数对象的Locale及其他格式化属性,计算数字的单复数类别。 | | ohos.intl | select(n:&nbsp;number):&nbsp;string<sup>8+</sup> | 依据单复数对象的Locale及其他格式化属性,计算数字的单复数类别。 |
...@@ -254,7 +254,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 ...@@ -254,7 +254,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方
### 接口说明 ### 接口说明
| 模块 | 接口名称 | 描述 | | 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- | | --------- | ---------------------------------------- | ---------------------------------------- |
| ohos.intl | constructor()<sup>8+</sup> | 创建相对时间格式化对象。 | | ohos.intl | constructor()<sup>8+</sup> | 创建相对时间格式化对象。 |
| ohos.intl | constructor(locale:&nbsp;string&nbsp;\|&nbsp;Array&lt;string&gt;,&nbsp;options?:&nbsp;RelativeTimeFormatInputOptions)<sup>8+</sup> | 创建相对时间格式化对象,并设置提供的locale和格式化相关属性。 | | ohos.intl | constructor(locale:&nbsp;string&nbsp;\|&nbsp;Array&lt;string&gt;,&nbsp;options?:&nbsp;RelativeTimeFormatInputOptions)<sup>8+</sup> | 创建相对时间格式化对象,并设置提供的locale和格式化相关属性。 |
| ohos.intl | format(value:&nbsp;number,&nbsp;unit:&nbsp;string):&nbsp;string<sup>8+</sup> | 依据相对时间格式化对象的Locale及其他格式化属性,计算相对时间的格式化表示。 | | ohos.intl | format(value:&nbsp;number,&nbsp;unit:&nbsp;string):&nbsp;string<sup>8+</sup> | 依据相对时间格式化对象的Locale及其他格式化属性,计算相对时间的格式化表示。 |
...@@ -307,4 +307,4 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 ...@@ -307,4 +307,4 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方
针对Intl开发,有以下相关实例可供参考: 针对Intl开发,有以下相关实例可供参考:
-[`International`:国际化(JS)(API7)](https://gitee.com/openharmony/app_samples/tree/master/UI/International) -[`International`:国际化(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/International)
\ No newline at end of file \ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
- 用于存放字符串、颜色、浮点数等基础元素,以及媒体等资源文件。 - 用于存放字符串、颜色、浮点数等基础元素,以及媒体等资源文件。
- 当前支持的文件和资源类型如下: - 当前支持的文件和资源类型如下:
| 文件名 | 资源类型 | | 文件名 | 资源类型 |
| -------- | -------- | | ----------- | ------------ |
| color.json | 颜色资源。 | | color.json | 颜色资源。 |
| float.json | 间距、圆角、字体等资源。 | | float.json | 间距、圆角、字体等资源。 |
| string.json | 字符串资源。 | | string.json | 字符串资源。 |
...@@ -168,4 +168,4 @@ Image($rawfile('newDir/newTest.png')) //rawfile$r引用rawfile目录下图片 ...@@ -168,4 +168,4 @@ Image($rawfile('newDir/newTest.png')) //rawfile$r引用rawfile目录下图片
针对访问应用资源,有以下相关实例可供参考: 针对访问应用资源,有以下相关实例可供参考:
- [`ResourceManager`:资源管理器(eTS)(API7](https://gitee.com/openharmony/app_samples/tree/master/common/ResourceManager) - [`ResourceManager`:资源管理器(eTS)(API8](https://gitee.com/openharmony/app_samples/tree/master/common/ResourceManager)
...@@ -580,11 +580,11 @@ transform可以设置多个值并且多个值可同时设置,下面案例中 ...@@ -580,11 +580,11 @@ transform可以设置多个值并且多个值可同时设置,下面案例中
针对transform样式动画开发,有以下相关实例可供参考: 针对transform样式动画开发,有以下相关实例可供参考:
- [`JsAnimation`:动效示例应用(JS)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimation) - [`JsAnimation`:动效示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimation)
- [`JsAnimationStyle`:动画与自定义字体(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimationStyle) - [`JsAnimationStyle`:动画与自定义字体(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimationStyle)
- [`Clock`:时钟(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/common/Clock) - [`Clock`:时钟(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/common/Clock)
- [动画样式(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/AnimationDemo) - [动画样式(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/AnimationDemo)
......
...@@ -25,19 +25,21 @@ ...@@ -25,19 +25,21 @@
针对组件开发,有以下相关实例可供参考: 针对组件开发,有以下相关实例可供参考:
- [`JsPanel`:内容展示面板(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/JsPanel) - [`JsPanel`:内容展示面板(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/JsPanel)
- [`Popup`:气泡(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/Popup) - [`Popup`:气泡(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/Popup)
- [`RefreshContainer`:下拉刷新容器(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/RefreshContainer) - [`RefreshContainer`:下拉刷新容器(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/RefreshContainer)
- [`JSComponments`:Js组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JSComponments) - [`JSComponments`:Js组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JSComponments)
- [`JsUserRegistration`:用户注册(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsUserRegistration) - [`JsUserRegistration`:用户注册(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsUserRegistration)
- [`ECG`:心率检测(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/common/ECG) - [`ECG`:心率检测(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/common/ECG)
- [`Badge`:事件标记控件(JS)(API7)](https://gitee.com/openharmony/app_samples/tree/master/UI/Badge) - [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Badge)
- [`JsVideo`:视频播放(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/media/JsVideo)
- [rating(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/RatingApplication) - [rating(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/RatingApplication)
......
...@@ -89,4 +89,4 @@ export default { ...@@ -89,4 +89,4 @@ export default {
针对页面路由开发,有以下相关实例可供参考: 针对页面路由开发,有以下相关实例可供参考:
- [`JsRouter`:页面路由(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/JsRouter) - [`JsRouter`:页面路由(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/JsRouter)
...@@ -314,4 +314,4 @@ export default { ...@@ -314,4 +314,4 @@ export default {
针对Tabs开发,有以下相关实例可供参考: 针对Tabs开发,有以下相关实例可供参考:
- [`Tabs`:页签容器(JS)(API7)](https://gitee.com/openharmony/app_samples/tree/master/UI/Tabs) - [`Tabs`:页签容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Tabs)
\ No newline at end of file \ No newline at end of file
...@@ -144,4 +144,4 @@ export default { ...@@ -144,4 +144,4 @@ export default {
针对Canvas开发,有以下相关实例可供参考: 针对Canvas开发,有以下相关实例可供参考:
- [`JsCanvas`:画布组件(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/JsCanvas) - [`JsCanvas`:画布组件(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/JsCanvas)
...@@ -619,6 +619,6 @@ export default { ...@@ -619,6 +619,6 @@ export default {
针对Chart开发,有以下相关实例可供参考: 针对Chart开发,有以下相关实例可供参考:
- [`Chart`:图表组件(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/chart) - [`Chart`:图表组件(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/chart)
- [chart(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/SwitchApplication) - [chart(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/SwitchApplication)
...@@ -325,6 +325,6 @@ export default { ...@@ -325,6 +325,6 @@ export default {
针对Dialog开发,有以下相关实例可供参考: 针对Dialog开发,有以下相关实例可供参考:
- [`JsDialog`:页面弹窗(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/JsDialog) - [`JsDialog`:页面弹窗(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/JsDialog)
- [dialog(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/DialogDemo) - [dialog(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/DialogDemo)
...@@ -248,4 +248,4 @@ export default { ...@@ -248,4 +248,4 @@ export default {
针对Grid开发,有以下相关实例可供参考: 针对Grid开发,有以下相关实例可供参考:
- [`JsGrid`:栅格组件(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/JsGrid) - [`JsGrid`:栅格组件(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/JsGrid)
...@@ -314,4 +314,4 @@ export default { ...@@ -314,4 +314,4 @@ export default {
针对List开发,有以下相关实例可供参考: 针对List开发,有以下相关实例可供参考:
- [`JsList`:商品列表(JS)(API7)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsList) - [`JsList`:商品列表(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsList)
\ No newline at end of file \ No newline at end of file
...@@ -283,4 +283,4 @@ export default { ...@@ -283,4 +283,4 @@ export default {
针对Menu开发,有以下相关实例可供参考: 针对Menu开发,有以下相关实例可供参考:
- [`JSMenu`:菜单(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/JSMenu) - [`JSMenu`:菜单(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/JSMenu)
...@@ -301,4 +301,4 @@ export default { ...@@ -301,4 +301,4 @@ export default {
针对Picker开发,有以下相关实例可供参考: 针对Picker开发,有以下相关实例可供参考:
- [`Picker`:滑动选择器(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/Picker) - [`Picker`:滑动选择器(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/Picker)
...@@ -217,6 +217,6 @@ export default{ ...@@ -217,6 +217,6 @@ export default{
针对Slider开发,有以下相关实例可供参考: 针对Slider开发,有以下相关实例可供参考:
- [`Slider`:滑动条(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/Slider) - [`Slider`:滑动条(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/Slider)
- [slider(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/SliderApplication) - [slider(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/SliderApplication)
\ No newline at end of file
...@@ -407,4 +407,4 @@ export default { ...@@ -407,4 +407,4 @@ export default {
针对Stepper开发,有以下相关实例可供参考: 针对Stepper开发,有以下相关实例可供参考:
- [`StepNavigator`:步骤导航器(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/StepNavigator) - [`StepNavigator`:步骤导航器(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/StepNavigator)
...@@ -84,4 +84,4 @@ svg{ ...@@ -84,4 +84,4 @@ svg{
针对Svg开发,有以下相关实例可供参考: 针对Svg开发,有以下相关实例可供参考:
- [`JsSvg`:可缩放矢量图形(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/JsSvg) - [`JsSvg`:可缩放矢量图形(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/JsSvg)
...@@ -369,4 +369,4 @@ export default { ...@@ -369,4 +369,4 @@ export default {
针对Swiper开发,有以下相关实例可供参考: 针对Swiper开发,有以下相关实例可供参考:
- [`Swiper`:内容滑动容器(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/Swiper) - [`Swiper`:内容滑动容器(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/Swiper)
...@@ -235,4 +235,4 @@ export default { ...@@ -235,4 +235,4 @@ export default {
针对Toolbar开发,有以下相关实例可供参考: 针对Toolbar开发,有以下相关实例可供参考:
- [`Toolbar`:工具栏(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/Toolbar) - [`Toolbar`:工具栏(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/Toolbar)
...@@ -103,6 +103,6 @@ ...@@ -103,6 +103,6 @@
针对自定义组件开发,有以下相关实例可供参考: 针对自定义组件开发,有以下相关实例可供参考:
- [`JSUICustomComponent`:自定义组件(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/JSUICustomComponent) - [`JSUICustomComponent`:自定义组件(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/JSUICustomComponent)
- [自定义组件(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/JSCanvasComponet) - [自定义组件(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/JSCanvasComponet)
...@@ -34,13 +34,13 @@ ...@@ -34,13 +34,13 @@
基于JS扩展的类Web开发范式的方舟开发框架,有以下相关实例可供参考: 基于JS扩展的类Web开发范式的方舟开发框架,有以下相关实例可供参考:
- [`AtomicLayout`:原子布局(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/AtomicLayout) - [`AtomicLayout`:原子布局(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/AtomicLayout)
- [`JsFA`:FA示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsFA) - [`JsFA`:FA示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsFA)
- [`JsShopping`:购物示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsShopping) - [`JsShopping`:购物示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsShopping)
- [`Stack`:堆叠容器(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/Stack) - [`Stack`:堆叠容器(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/Stack)
- [`JsAdaptivePortalList`:多设备自适应的效率型首页(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAdaptivePortalList) - [`JsAdaptivePortalList`:多设备自适应的效率型首页(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAdaptivePortalList)
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
- [`JsGallery`:图库示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsGallery) - [`JsGallery`:图库示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsGallery)
- [`AirQuality`:空气质量(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/common/AirQuality) - [`AirQuality`:空气质量(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/common/AirQuality)
- [`Badge`:事件标记控件(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/UI/Badge) - [`Badge`:事件标记控件(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/UI/Badge)
- [购物应用(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/ShoppingOpenHarmony) - [购物应用(JS)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/ShoppingOpenHarmony)
...@@ -198,4 +198,4 @@ struct WebComponent { ...@@ -198,4 +198,4 @@ struct WebComponent {
针对Web开发,有以下相关实例可供参考: 针对Web开发,有以下相关实例可供参考:
- [`Web`:ArkUI-Web(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Web) - [`Web`:Web(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Web)
\ No newline at end of file \ No newline at end of file
...@@ -531,6 +531,6 @@ ...@@ -531,6 +531,6 @@
针对创建简单视图,有以下示例工程可供参考: 针对创建简单视图,有以下示例工程可供参考:
- [eTSBuildCommonView](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/BuildCommonView) - [`BuildCommonView`:创建简单视图(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/BuildCommonView)
本示例为构建了简单页面展示食物番茄的图片和营养信息,主要为了展示简单页面的Stack布局和Flex布局。 本示例为构建了简单页面展示食物番茄的图片和营养信息,主要为了展示简单页面的Stack布局和Flex布局。
...@@ -152,5 +152,5 @@ listener.on('change', onPortrait) ...@@ -152,5 +152,5 @@ listener.on('change', onPortrait)
针对媒体查询开发,有以下相关实例可供参考: 针对媒体查询开发,有以下相关实例可供参考:
- [`MediaQuery`:Ets媒体查询(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/MediaQuery) - [`MediaQuery`:媒体查询(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/MediaQuery)
...@@ -63,13 +63,17 @@ ...@@ -63,13 +63,17 @@
- [`Canvas`:画布组件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Canvas) - [`Canvas`:画布组件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Canvas)
- [`Drag`:ArkUI-拖拽事件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Drag) - [`Drag`:拖拽事件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Drag)
- [`ArkUIAnimation`:Ets动画(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/ArkUIAnimation) - [`ArkUIAnimation`:动画(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/ArkUIAnimation)
- [`Xcomponent`:ArkUI-XComponent(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/XComponent) - [`Xcomponent`:XComponent(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/XComponent)
- [`MouseEvent`:ArkUI-鼠标事件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/MouseEvent) - [`MouseEvent`:鼠标事件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/MouseEvent)
- [`Gallery`:组件集合(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Gallery)
- [`BringApp`:拉起系统应用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/BringApp)
- [极简声明式UI范式(eTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SimpleGalleryEts) - [极简声明式UI范式(eTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SimpleGalleryEts)
......
...@@ -267,6 +267,6 @@ ...@@ -267,6 +267,6 @@
针对页面布局与连接,有以下示例工程可供参考: 针对页面布局与连接,有以下示例工程可供参考:
- [eTSDefiningPageLayoutAndConnection](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/DefiningPageLayoutAndConnection) - [`DefiningPageLayoutAndConnection`:页面布局和连接(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/DefiningPageLayoutAndConnection)
本示例构建了食物分类列表页面和食物详情页,向开发者展示了List布局、Grid布局以及页面路由的基本用法。 本示例构建了食物分类列表页面和食物详情页,向开发者展示了List布局、Grid布局以及页面路由的基本用法。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册