未验证 提交 9c594465 编写于 作者: O openharmony_ci 提交者: Gitee

!3338 开发指南中引入Samples/Codelabs&快速入门system.router改为ohos.router:无需翻译

Merge pull request !3338 from 葛亚芳/OpenHarmony-3.1-Release
......@@ -118,7 +118,7 @@ You can implement page redirection through the page router, which finds the targ
- In the **index.ets** file:
```
import router from '@system.router';
import router from '@ohos.router';
@Entry
@Component
......@@ -131,7 +131,7 @@ You can implement page redirection through the page router, which finds the targ
*/
onclick() {
router.push({
uri: 'pages/second', // Specify the page to be redirected to.
url: 'pages/second', // Specify the page to be redirected to.
})
}
......@@ -149,7 +149,7 @@ You can implement page redirection through the page router, which finds the targ
- In the **second.ets** file:
```
import router from '@system.router';
import router from '@ohos.router';
@Entry
@Component
......
......@@ -153,7 +153,7 @@ You can implement page redirection through the page router, which finds the targ
```
import router from '@system.router';
import router from '@ohos.router';
@Entry
@Component
......@@ -181,7 +181,7 @@ You can implement page redirection through the page router, which finds the targ
.height('5%')
// Bind the onClick event to the Next button so that clicking the button redirects the user to the second page.
.onClick(() => {
router.push({ uri: 'pages/second' })
router.push({ url: 'pages/second' })
})
}
.width('100%')
......@@ -196,7 +196,7 @@ You can implement page redirection through the page router, which finds the targ
```
import router from '@system.router';
import router from '@ohos.router';
@Entry
@Component
......
......@@ -104,12 +104,12 @@ You can implement page redirection through the [page router](../ui/ui-js-buildin
- In the **index.js** file:
```
import router from '@system.router';
import router from '@ohos.router';
export default {
onclick() {
router.push({
uri:'pages/second/second', // Specify the page to be redirected to.
url:'pages/second/second', // Specify the page to be redirected to.
})
}
}
......@@ -127,7 +127,7 @@ You can implement page redirection through the [page router](../ui/ui-js-buildin
- In the **second.js** file:
```
import router from '@system.router';
import router from '@ohos.router';
export default {
back() {
......
......@@ -163,12 +163,12 @@ You can implement page redirection through the [page router](../ui/ui-js-buildin
```
import router from '@system.router';
import router from '@ohos.router';
export default {
onclick: function () {
router.push({
uri: "pages/second/second"
url: "pages/second/second"
})
}
}
......@@ -179,7 +179,7 @@ You can implement page redirection through the [page router](../ui/ui-js-buildin
```
import router from '@system.router';
import router from '@ohos.router';
export default {
back: function () {
......
......@@ -32,4 +32,15 @@ Ability框架在API 8及更早版本使用FA模型。FA模型中Ability分为Pag
## 进程线程模型
应用独享独立进程,Ability独享独立线程,应用进程在Ability第一次启动时创建,并为启动的Ability创建线程,应用启动后再启动应用内其他Ability,会为每一个Ability创建相应的线程。每个Ability绑定一个独立的JSRuntime实例,因此Ability之间是隔离的。
![fa-threading-nodel](figures/fa-threading-model.png)
\ No newline at end of file
![fa-threading-nodel](figures/fa-threading-model.png)
## 相关实例
针对Ability开发,有以下相关实例可供参考:
- [Page内和Page间导航跳转](https://gitee.com/openharmony/codelabs/tree/master/Ability/PageAbility)
- [分布式调度启动远程FA](https://gitee.com/openharmony/codelabs/tree/master/Distributed/RemoteStartFA)
- [分布式新闻客户端](https://gitee.com/openharmony/codelabs/tree/master/Distributed/NewsDemo)
- [分布式手写板(eTS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/DistributeDatabaseDrawEts)
- [分布式鉴权(JS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/GameAuthOpenH)
- [分布式游戏手柄(eTS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/HandleGameApplication)
- [分布式邮件(eTS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/OHMailETS)
- [分布式亲子早教系统(eTS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/OpenHarmonyPictureGame)
- [分布式遥控器(eTS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/RemoteControllerETS)
\ No newline at end of file
......@@ -272,14 +272,8 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开
);
```
## 开发实例
## 相关实例
针对dataAbility开发,有以下示例工程可供参考:
针对DataAbility开发,有以下相关实例可供参考:
- [DataAbility](https://gitee.com/openharmony/app_samples/tree/master/ability/DataAbility)
本示例DataAbility中:
在DataAbility目录中的data.ts文件创建一个Data实例。
在MainAbility目录中封装了访问Data的流程。
- [`DataAbility`:DataAbility的创建与访问(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/DataAbility)
......@@ -326,10 +326,8 @@ Form需要在应用配置文件config.json中进行配置。
![fa-form-example](figures/fa-form-example.png)
## 开发实例
## 相关实例
针对FA模型卡片提供方的开发,有以下示例工程可供参考:
[FormAbility](https://gitee.com/openharmony/app_samples/tree/master/ability/FormAbility)
本示例FormAbility提供了一张卡片。用户可以通过桌面或者自己开发的卡片使用方,进行卡片的创建、更新和删除等操作。并且本示例通过轻量级数据存储实现了卡片信息的持久化。
\ No newline at end of file
针对FA模型卡片提供方的开发,有以下相关实例可供参考:
- [`FormAbility`:FA模型卡片(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/FormAbility)
- [`FormLauncher`:卡片使用方(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/FormLauncher)
\ No newline at end of file
......@@ -259,9 +259,6 @@ export default {
},
}
```
### 开发实例
针对pageAbility开发,有以下示例工程可供参考:
[DMS](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
在本示例中完整展示了启动本地Ability、启动远程Ability的使用方法。
\ No newline at end of file
## 相关实例
针对PageAbility开发,有以下相关实例可供参考:
- [`DMS`:分布式Demo(eTS)(API7)](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
\ No newline at end of file
......@@ -395,25 +395,8 @@ export default {
};
```
## 开发实例
## 相关实例
### 针对serviceAbility开发,有以下示例工程可供参考:
- [ServiceAbility](https://gitee.com/openharmony/app_samples/tree/master/ability/ServiceAbility)
本示例ServiceAbility中:
在ServiceAbility目录中的service.ts文件创建一个本地Service。
在MainAbility目录中封装了启动、连接本地Services的流程。
### 针对跨设备serviceAbility开发,有以下示例工程可供参考:
- [DMS](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
本示例DMS中:
在ServiceAbility目录中的service.ts文件创建一个远程Service。
在RemoteAbility目录中封装了连接远程Services的流程。
针对ServiceAbility开发,有以下相关实例可供参考:
- [`ServiceAbility`:ServiceAbility的创建与使用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/ServiceAbility)
- [`DMS`:分布式Demo(eTS)(API7)](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
\ No newline at end of file
......@@ -172,3 +172,7 @@ OpenHarmony系统中的分布式数据服务模块为开发者提供下面几种
}
kvStore.sync(deviceIds, distributedData.SyncMode.PUSH_ONLY, 1000);
```
## 相关实例
针对分布式数据开发,有以下相关实例可供参考:
- [`KvStore`:分布式数据库(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/data/Kvstore)
- [分布式数据库](https://gitee.com/openharmony/codelabs/tree/master/Data/JsDistributedData)
\ No newline at end of file
......@@ -306,3 +306,7 @@
let tableName = rdbStore.obtainDistributedTableName(deviceId, "test");
let resultSet = rdbStore.querySql("SELECT * FROM " + tableName)
```
## 相关实例
针对关系型数据库开发,有以下相关实例可供参考:
- [`Rdb`:关系型数据库(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/data/Rdb)
- [关系型数据库](https://gitee.com/openharmony/codelabs/tree/master/Data/JSRelationshipData)
\ No newline at end of file
......@@ -161,4 +161,9 @@
console.info("Deleted successfully.")
}).catch((err) => {
console.info("Deleted failed with err: " + err)})
```
\ No newline at end of file
```
## 相关实例
针对轻量级数据存储开发,有以下相关实例可供参考:
- [`LiteStorage`:轻量级存储(eTS)(API7)](https://gitee.com/openharmony/app_samples/tree/master/data/LiteStorage)
- [轻量级偏好数据库](https://gitee.com/openharmony/codelabs/tree/master/Data/Database)
- [备忘录(eTS)](https://gitee.com/openharmony/codelabs/tree/master/Data/NotePad_OH_ETS)
\ No newline at end of file
......@@ -120,7 +120,7 @@ OpenHarmony低代码开发方式具有丰富的UI界面编辑功能,通过可
-**index.ets**”示例如下:
```
import router from '@system.router';
import router from '@ohos.router';
@Entry
@Component
......@@ -133,7 +133,7 @@ OpenHarmony低代码开发方式具有丰富的UI界面编辑功能,通过可
*/
onclick() {
router.push({
uri: 'pages/second', // 指定要跳转的页面
url: 'pages/second', // 指定要跳转的页面
})
}
......@@ -151,7 +151,7 @@ OpenHarmony低代码开发方式具有丰富的UI界面编辑功能,通过可
-**second.ets**”示例如下:
```
import router from '@system.router';
import router from '@ohos.router';
@Entry
@Component
......
......@@ -155,7 +155,7 @@
```
import router from '@system.router';
import router from '@ohos.router';
@Entry
@Component
......@@ -183,7 +183,7 @@
.height('5%')
// 跳转按钮绑定onClick事件,点击时跳转到第二页
.onClick(() => {
router.push({ uri: 'pages/second' })
router.push({ url: 'pages/second' })
})
}
.width('100%')
......@@ -198,7 +198,7 @@
```
import router from '@system.router';
import router from '@ohos.router';
@Entry
@Component
......
......@@ -107,12 +107,12 @@ OpenHarmony低代码开发方式具有丰富的UI界面编辑功能,通过可
-**index.js**”示例如下:
```
import router from '@system.router';
import router from '@ohos.router';
export default {
onclick() {
router.push({
uri:'pages/second/second', // 指定要跳转的页面
url:'pages/second/second', // 指定要跳转的页面
})
}
}
......@@ -130,7 +130,7 @@ OpenHarmony低代码开发方式具有丰富的UI界面编辑功能,通过可
-**second.js**”示例如下:
```
import router from '@system.router';
import router from '@ohos.router';
export default {
back() {
......
......@@ -168,12 +168,12 @@
```
import router from '@system.router';
import router from '@ohos.router';
export default {
onclick: function () {
router.push({
uri: "pages/second/second"
url: "pages/second/second"
})
}
}
......@@ -184,7 +184,7 @@
```
import router from '@system.router';
import router from '@ohos.router';
export default {
back: function () {
......@@ -210,3 +210,6 @@
![zh-cn_image_0000001217527892](figures/zh-cn_image_0000001217527892.png)
恭喜您已经使用JS语言开发(传统代码方式)完成了第一个OpenHarmony应用,快来[探索更多的OpenHarmony功能](../application-dev-guide.md)吧。
## 相关实例
针对使用JS语言(传统代码方式)开发快速入门,有以下相关实例可供参考:
- [`JsHelloWorld`:你好世界(JS)(API7)](https://gitee.com/openharmony/app_samples/tree/master/common/JsHelloWorld)
\ No newline at end of file
......@@ -35,4 +35,6 @@ screenshot.save(ScreenshotOptions).then((image) => {
console.log('screenshot.save failed, error : ' + JSON.stringify(err));
})
```
## 相关实例
针对屏幕截图开发,有以下相关实例可供参考:
- [`Screenshot`:基础功能-屏幕截图(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/Basic/Screenshot)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册