Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
ef20945e
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,发现更多精彩内容 >>
未验证
提交
ef20945e
编写于
12月 01, 2022
作者:
O
openharmony_ci
提交者:
Gitee
12月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
!12047 Modify the example
Merge pull request !12047 from 小马奔腾/master
上级
b842abc4
1fa5ffff
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
8 deletion
+8
-8
zh-cn/application-dev/reference/apis/js-apis-convertxml.md
zh-cn/application-dev/reference/apis/js-apis-convertxml.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-url.md
zh-cn/application-dev/reference/apis/js-apis-url.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-util.md
zh-cn/application-dev/reference/apis/js-apis-util.md
+3
-3
zh-cn/application-dev/reference/apis/js-apis-worker.md
zh-cn/application-dev/reference/apis/js-apis-worker.md
+2
-2
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-convertxml.md
浏览文件 @
ef20945e
...
...
@@ -46,13 +46,13 @@ let xml =
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
let
conv
=
new
convertxml
.
convertToJSObject
();
let
conv
=
new
convertxml
.
ConvertXML
()
let
options
=
{
trim
:
false
,
declarationKey
:
"
_declaration
"
,
instructionKey
:
"
_instruction
"
,
attributesKey
:
"
_attributes
"
,
textKey
:
"
_text
"
,
cdataKey
:
"
_cdata
"
,
doctypeKey
:
"
_doctype
"
,
commentKey
:
"
_comment
"
,
parentKey
:
"
_parent
"
,
typeKey
:
"
_type
"
,
nameKey
:
"
_name
"
,
elementsKey
:
"
_elements
"
}
let
result
=
JSON
.
stringify
(
conv
.
convert
(
xml
,
options
));
let
result
=
JSON
.
stringify
(
conv
.
convert
ToJSObject
(
xml
,
options
));
console
.
log
(
result
);
// 输出(宽泛型)
// {"_declaration":{"_attributes":{"version":"1.0","encoding":"utf-8"}},"_elements":[{"_type":"element","_name":"note","_attributes":{"importance":"high","logged":"true"},"_elements":[{"_type":"element","_name":"title","_elements":[{"_type":"text","_text":"Happy"}]},{"_type":"element","_name":"todo","_elements":[{"_type":"text","_text":"Work"}]},{"_type":"element","_name":"todo","_elements":[{"_type":"text","_text":"Play"}]}]}]}
...
...
zh-cn/application-dev/reference/apis/js-apis-url.md
浏览文件 @
ef20945e
...
...
@@ -165,7 +165,7 @@ forEach(callbackFn: (value: string, key: string, searchParams: this) => void, th
```
js
const
myURLObject
=
new
Url
.
URL
(
'
https://developer.exampleUrl/?fod=1&bard=2
'
);
myURLObject
.
URL
Params
.
forEach
((
value
,
name
,
searchParams
)
=>
{
myURLObject
.
search
Params
.
forEach
((
value
,
name
,
searchParams
)
=>
{
console
.
log
(
name
,
value
,
myURLObject
.
searchParams
===
searchParams
);
});
```
...
...
zh-cn/application-dev/reference/apis/js-apis-util.md
浏览文件 @
ef20945e
...
...
@@ -668,8 +668,7 @@ parseRationalNumber(numerator: number,denominator: number): RationalNumber
**示例:**
```
js
let
rationalNumber
=
new
util
.
RationalNumber
();
rationalNumber
.
parseRationalNumber
(
1
,
2
)
let
rationalNumber
=
util
.
RationalNumber
.
parseRationalNumber
(
1
,
2
)
```
### constructor<sup>(deprecated)</sup>
...
...
@@ -1488,7 +1487,8 @@ contains(key: object): boolean
```
js
let
pro
=
new
util
.
LRUCache
();
pro
.
put
(
2
,
10
);
let
result
=
pro
.
contains
(
20
);
let
obj
=
{
1
:
"
key
"
};
let
result
=
pro
.
contains
(
obj
);
```
...
...
zh-cn/application-dev/reference/apis/js-apis-worker.md
浏览文件 @
ef20945e
...
...
@@ -423,7 +423,7 @@ dispatchEvent(event: Event): boolean
```
js
const
workerInstance
=
new
worker
.
ThreadWorker
(
"
workers/worker.js
"
);
workerInstance
.
dispatchEvent
({
type
:
"
alert
"
});
workerInstance
.
dispatchEvent
({
type
:
"
alert
"
,
timeStamp
:
0
});
```
...
...
@@ -1424,7 +1424,7 @@ workerInstance.onmessage = function(d) {
import
worker
from
'
@ohos.worker
'
;
const
parentPort
=
worker
.
workerPort
;
class
MyModel
{
name
:
"
undefined
"
name
=
"
undefined
"
Init
()
{
this
.
name
=
"
MyModel
"
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录