Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
3a939b6f
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,发现更多精彩内容 >>
未验证
提交
3a939b6f
编写于
3月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2424 自动化测试问题修改:js-apis-data-rdb.md需同步翻译
Merge pull request !2424 from zengyawen/master
上级
cd443945
66fb1a0c
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
240 addition
and
242 deletion
+240
-242
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
+7
-5
zh-cn/application-dev/reference/apis/js-apis-pasteboard.md
zh-cn/application-dev/reference/apis/js-apis-pasteboard.md
+184
-188
zh-cn/application-dev/reference/apis/js-apis-request.md
zh-cn/application-dev/reference/apis/js-apis-request.md
+49
-49
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
浏览文件 @
3a939b6f
...
...
@@ -1612,10 +1612,10 @@ sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback<Array
**示例**
:
```
let predicatesync = new rdb.RdbPredicates('EMPLOYEE')
let predicatesync = new
data_
rdb.RdbPredicates('EMPLOYEE')
predicatesync.inDevices(['12345678abcde'])
let promisesync = rdbStore.sync(rdb.SyncMode.SYNC_MODE_PUSH, predicatesync)
promisesync.then((result) {
let promisesync = rdbStore.sync(
data_
rdb.SyncMode.SYNC_MODE_PUSH, predicatesync)
promisesync.then((result)
=>
{
console.log('sync done.')
for (let i = 0; i < result.length; i++) {
console.log('device=' + result[i][0] + ' status=' + result[i][1])
...
...
@@ -1634,6 +1634,7 @@ on(event: 'dataChange', type: SubscribeType, observer: Callback<Array<stri
**系统能力**
:SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| type | SubscribeType | 是 | 指在{@code SubscribeType}中定义的订阅类型。 |
...
...
@@ -1647,7 +1648,7 @@ on(event: 'dataChange', type: SubscribeType, observer: Callback<Array<stri
}
}
try {
rdbStore.on('dataChange', rdb.SubscribeType.SUBSCRIBE_TYPE_REMOTE, storeObserver)
rdbStore.on('dataChange',
data_
rdb.SubscribeType.SUBSCRIBE_TYPE_REMOTE, storeObserver)
} catch (err) {
console.log('register observer failed')
}
...
...
@@ -1662,6 +1663,7 @@ off(event:'dataChange', type: SubscribeType, observer: Callback<Array<stri
**系统能力**
:SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| type | SubscribeType | 是 | 指在{@code SubscribeType}中定义的订阅类型。 |
...
...
@@ -1675,7 +1677,7 @@ off(event:'dataChange', type: SubscribeType, observer: Callback<Array<stri
}
}
try {
rdbStore.off('dataChange', rdb.SubscribeType.SUBSCRIBE_TYPE_REMOTE, storeObserver)
rdbStore.off('dataChange',
data_
rdb.SubscribeType.SUBSCRIBE_TYPE_REMOTE, storeObserver)
} catch (err) {
console.log('unregister observer failed')
}
...
...
zh-cn/application-dev/reference/apis/js-apis-pasteboard.md
浏览文件 @
3a939b6f
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-request.md
浏览文件 @
3a939b6f
...
...
@@ -150,10 +150,10 @@ on(type: 'progress', callback:(uploadedSize: number, totalSize: number) => vo
-
示例:
```
uploadTask.on('progress', callback);
callback(uploadedSize, totalSize) {
uploadTask.on('progress', function callback(uploadedSize, totalSize) {
console.info("upload totalSize:" + totalSize + " uploadedSize:" + uploadedSize);
}
);
```
...
...
@@ -171,7 +171,7 @@ on(type: 'headerReceive', callback: (header: object) => void): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| type | string | 是 | 订阅的事件类型,取值为'headerReceive'(接收响应头)。 |
| callback |
header:
object
| 是 | HTTP
Response
Header事件的回调函数。 |
| callback |
function
| 是 | HTTP
Response
Header事件的回调函数。 |
回调函数的参数:
...
...
@@ -182,10 +182,10 @@ on(type: 'headerReceive', callback: (header: object) => void): void
-
示例:
```
uploadTask.on('headerReceive', callback);
callback(headers){
uploadTask.on('headerReceive', function callback(headers){
console.info("upOnHeader headers:" + JSON.stringify(headers));
}
);
```
...
...
@@ -215,10 +215,10 @@ off(type: 'progress', callback?: (uploadedSize: number, totalSize: number) =&g
-
示例:
```
uploadTask.off('progress', callback);
callback(uploadedSize, totalSize) {
uploadTask.off('progress', function callback(uploadedSize, totalSize) {
console.info('uploadedSize: ' + uploadedSize, 'totalSize: ' + totalSize);
}
);
```
...
...
@@ -236,7 +236,7 @@ off(type: 'headerReceive', callback?: (header: object) => void): void
| 参数名 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| type | string | 是 | 取消订阅的事件类型,取值为'headerReceive'(接收响应头)。 |
| callback |
header:
object
| 否 | HTTP
Response
Header事件的回调函数。 |
| callback |
function
| 否 | HTTP
Response
Header事件的回调函数。 |
回调函数的参数:
...
...
@@ -247,10 +247,10 @@ off(type: 'headerReceive', callback?: (header: object) => void): void
-
示例:
```
uploadTask.off('headerReceive', callback);
callback(headers) {
uploadTask.off('headerReceive', function callback(headers) {
console.info("upOnHeader headers:" + JSON.stringify(headers));
}
);
```
...
...
@@ -449,11 +449,11 @@ on(type: 'progress', callback:(receivedSize: number, totalSize: number) => vo
return;
}
downloadTask = data;
downloadTask.on('progress', download_callback);
});
download_callback(receivedSize, totalSize) {
downloadTask.on('progress', function download_callback(receivedSize, totalSize) {
console.info("download receivedSize:" + receivedSize + " totalSize:" + totalSize);
}
);
});
```
...
...
@@ -489,11 +489,11 @@ off(type: 'progress', callback?: (receivedSize: number, totalSize: number) =>
return;
}
downloadTask = data;
downloadTask .off('progress', download_callback);
downloadTask .off('progress', function download_callback(receivedSize, totalSize) {
console.info("download receivedSize:" + receivedSize + " totalSize:" + totalSize);
}
);
});
download_callback(receivedSize, totalSize) {
console.info("download receivedSize:" + receivedSize + " totalSize:" + totalSize);
}
```
...
...
@@ -522,11 +522,11 @@ on(type: 'complete', callback:() => void): void
return;
}
downloadTask= data;
downloadTask.on('complete',callback);
downloadTask.on('complete', function callback() {
console.info('Download task completed.');
}
);
});
callback() {
console.info('Download task completed.');
}
```
...
...
@@ -555,11 +555,11 @@ off(type: 'complete', callback?:() => void): void
return;
}
downloadTask = data;
downloadTask.off('complete',callback);
downloadTask.off('complete', function callback() {
console.info('Download task completed.');
}
);
});
callback() {
console.info('Download task completed.');
}
```
...
...
@@ -594,11 +594,11 @@ on(type: 'fail', callback: (err: number) => void): void
return;
}
downloadTask = data;
downloadTask.on('fail', callBack);
downloadTask.on('fail', function callBack(err) {
console.info('Download task failed. Cause:' + err);
}
);
});
callBack(err) {
console.info('Download task failed. Cause:' + err);
}
```
...
...
@@ -633,11 +633,11 @@ off(type: 'fail', callback?: (err: number) => void): void
return;
}
downloadTask = data;
downloadTask.off('fail', callBack);
downloadTask.off('fail', function callBack(err) {
console.info('Download task failed. Cause:' + err);
}
);
});
callBack(err) {
console.info('Download task failed. Cause:' + err);
}
```
...
...
@@ -666,11 +666,11 @@ on(type: 'pause', callback:() => void): void
return;
}
downloadTask = data;
downloadTask.on('pause', callBack);
downloadTask.on('pause', function callBack() {
console.info('Download task paused.');
}
);
});
callBack() {
console.info('Download task paused.');
}
```
...
...
@@ -699,11 +699,11 @@ off(type: 'pause', callback?:() => void): void
return;
}
downloadTask = data;
downloadTask.off('pause', callBack);
downloadTask.off('pause', function callBack() {
console.info('Download task paused.');
}
);
});
callBack() {
console.info('Download task paused.');
}
```
...
...
@@ -732,11 +732,11 @@ on(type: 'remove', callback:() => void): void
return;
}
downloadTask = data;
downloadTask.on('remove', callBack);
downloadTask.on('remove', function callBack() {
console.info('Download task removed.');
}
);
});
callBack() {
console.info('Download task removed.');
}
```
...
...
@@ -764,11 +764,11 @@ off(type: 'remove', callback?:() => void): void
console.error('Failed to remove the download task. Cause:' + JSON.stringify(err));
}
downloadTask = data;
downloadTask.off('remove', callBack);
downloadTask.off('remove', function callBack() {
console.info('Download task removed.');
}
);
});
callBack() {
console.info('Download task removed.');
}
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录