Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
8c462a9f
D
Docs
项目概览
OpenHarmony
/
Docs
接近 2 年 前同步成功
通知
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看板
“d3a86c673b8ec91f4bf7d930f9fc34f4fd29ae75”上不存在“paddle/gserver/layers/MKLDNNLRNLayer.h”
提交
8c462a9f
编写于
5月 17, 2023
作者:
Y
yamila
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update consistence
Signed-off-by:
N
yamila
<
tianyu55@huawei.com
>
上级
8c176ecf
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
160 addition
and
134 deletion
+160
-134
zh-cn/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md
...ion-dev/reference/apis/js-apis-arkui-componentSnapshot.md
+35
-19
zh-cn/application-dev/reference/apis/js-apis-arkui-drawableDescriptor.md
...on-dev/reference/apis/js-apis-arkui-drawableDescriptor.md
+25
-16
zh-cn/application-dev/reference/apis/js-apis-measure.md
zh-cn/application-dev/reference/apis/js-apis-measure.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-plugincomponent.md
...application-dev/reference/apis/js-apis-plugincomponent.md
+83
-82
zh-cn/application-dev/reference/apis/js-apis-router.md
zh-cn/application-dev/reference/apis/js-apis-router.md
+11
-11
zh-cn/application-dev/reference/apis/js-apis-system-router.md
...n/application-dev/reference/apis/js-apis-system-router.md
+4
-4
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-sharp-clipping.md
...erence/arkui-ts/ts-universal-attributes-sharp-clipping.md
+1
-1
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md
浏览文件 @
8c462a9f
...
@@ -49,7 +49,7 @@ struct SnapshotExample {
...
@@ -49,7 +49,7 @@ struct SnapshotExample {
// ...Components
// ...Components
Button
(
"
click to generate UI snapshot
"
)
Button
(
"
click to generate UI snapshot
"
)
.
onClick
(()
=>
{
.
onClick
(()
=>
{
componentSnapshot
.
get
(
"
root
"
,
(
error
:
Business
Error
,
pixmap
:
image
.
PixelMap
)
=>
{
componentSnapshot
.
get
(
"
root
"
,
(
error
:
Error
,
pixmap
:
image
.
PixelMap
)
=>
{
this
.
pixmap
=
pixmap
this
.
pixmap
=
pixmap
// save pixmap to file
// save pixmap to file
// ....
// ....
...
@@ -85,6 +85,12 @@ get(id: string): Promise<image.PixelMap>
...
@@ -85,6 +85,12 @@ get(id: string): Promise<image.PixelMap>
| ----------------------------- | -------------- |
| ----------------------------- | -------------- |
| Promise
<
image.PixelMap
>
| 截图返回的结果。 |
| Promise
<
image.PixelMap
>
| 截图返回的结果。 |
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ------------------- |
| 100001 | if id is not valid. |
**示例:**
**示例:**
```
js
```
js
...
@@ -139,9 +145,10 @@ createFromBuilder(builder: CustomBuilder, callback: AsyncCallback<image.PixelMap
...
@@ -139,9 +145,10 @@ createFromBuilder(builder: CustomBuilder, callback: AsyncCallback<image.PixelMap
**示例:**
**示例:**
```
j
s
```
t
s
import
componentSnapshot
from
'
@ohos.arkui.componentSnapshot
'
import
componentSnapshot
from
'
@ohos.arkui.componentSnapshot
'
import
image
from
'
@ohos.multimedia.image
'
import
image
from
'
@ohos.multimedia.image
'
@
Entry
@
Entry
@
Component
@
Component
struct
OffscreenSnapshotExample
{
struct
OffscreenSnapshotExample
{
...
@@ -149,7 +156,7 @@ struct OffscreenSnapshotExample {
...
@@ -149,7 +156,7 @@ struct OffscreenSnapshotExample {
@
Builder
@
Builder
RandomBuilder
()
{
RandomBuilder
()
{
Flex
({
direction
:
FlexDirection
.
Column
,
justifyContent
:
FlexAlign
.
Center
,
alignItems
:
ItemAlign
.
Center
})
{
Flex
({
direction
:
FlexDirection
.
Column
,
justifyContent
:
FlexAlign
.
Center
,
alignItems
:
ItemAlign
.
Center
})
{
Text
(
'
Test menu item 1
'
)
Text
(
'
Test menu item 1
'
)
.
fontSize
(
20
)
.
fontSize
(
20
)
.
width
(
100
)
.
width
(
100
)
...
@@ -163,16 +170,17 @@ struct OffscreenSnapshotExample {
...
@@ -163,16 +170,17 @@ struct OffscreenSnapshotExample {
.
textAlign
(
TextAlign
.
Center
)
.
textAlign
(
TextAlign
.
Center
)
}.
width
(
100
)
}.
width
(
100
)
}
}
build
()
{
build
()
{
Column
()
{
Column
()
{
Button
(
"
click to generate offscreen UI snapshot
"
)
Button
(
"
click to generate offscreen UI snapshot
"
)
.
onClick
(()
=>
{
.
onClick
(()
=>
{
componentSnapshot
.
createFromBuilder
(
this
.
RandomBuilder
.
bind
(
this
),
componentSnapshot
.
createFromBuilder
(
this
.
RandomBuilder
.
bind
(
this
),
(
error
:
Business
Error
,
pixmap
:
image
.
PixelMap
)
=>
{
(
error
:
Error
,
pixmap
:
image
.
PixelMap
)
=>
{
this
.
pixmap
=
pixmap
this
.
pixmap
=
pixmap
// save pixmap to file
// save pixmap to file
// ....
// ....
})
})
})
})
}.
width
(
'
80%
'
).
margin
({
left
:
10
,
top
:
5
,
bottom
:
5
}).
height
(
200
)
}.
width
(
'
80%
'
).
margin
({
left
:
10
,
top
:
5
,
bottom
:
5
}).
height
(
200
)
.
border
({
color
:
'
#880606
'
,
width
:
2
})
.
border
({
color
:
'
#880606
'
,
width
:
2
})
...
@@ -200,11 +208,18 @@ createFromBuilder(builder: CustomBuilder): Promise<image.PixelMap>
...
@@ -200,11 +208,18 @@ createFromBuilder(builder: CustomBuilder): Promise<image.PixelMap>
| ----------------------------- | -------------- |
| ----------------------------- | -------------- |
| Promise
<
image.PixelMap
>
| 截图返回的结果。 |
| Promise
<
image.PixelMap
>
| 截图返回的结果。 |
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ----------------------------------------- |
| 100001 | if builder is not a valid build function. |
**示例:**
**示例:**
```
j
s
```
t
s
import
componentSnapshot
from
'
@ohos.arkui.componentSnapshot
'
import
componentSnapshot
from
'
@ohos.arkui.componentSnapshot
'
import
image
from
'
@ohos.multimedia.image
'
import
image
from
'
@ohos.multimedia.image
'
@
Entry
@
Entry
@
Component
@
Component
struct
OffscreenSnapshotExample
{
struct
OffscreenSnapshotExample
{
...
@@ -212,7 +227,7 @@ struct OffscreenSnapshotExample {
...
@@ -212,7 +227,7 @@ struct OffscreenSnapshotExample {
@
Builder
@
Builder
RandomBuilder
()
{
RandomBuilder
()
{
Flex
({
direction
:
FlexDirection
.
Column
,
justifyContent
:
FlexAlign
.
Center
,
alignItems
:
ItemAlign
.
Center
})
{
Flex
({
direction
:
FlexDirection
.
Column
,
justifyContent
:
FlexAlign
.
Center
,
alignItems
:
ItemAlign
.
Center
})
{
Text
(
'
Test menu item 1
'
)
Text
(
'
Test menu item 1
'
)
.
fontSize
(
20
)
.
fontSize
(
20
)
.
width
(
100
)
.
width
(
100
)
...
@@ -226,16 +241,17 @@ struct OffscreenSnapshotExample {
...
@@ -226,16 +241,17 @@ struct OffscreenSnapshotExample {
.
textAlign
(
TextAlign
.
Center
)
.
textAlign
(
TextAlign
.
Center
)
}.
width
(
100
)
}.
width
(
100
)
}
}
build
()
{
build
()
{
Column
()
{
Column
()
{
Button
(
"
click to generate offscreen UI snapshot
"
)
Button
(
"
click to generate offscreen UI snapshot
"
)
.
onClick
(()
=>
{
.
onClick
(()
=>
{
componentSnapshot
.
createFromBuilder
(
this
.
RandomBuilder
.
bind
(
this
))
componentSnapshot
.
createFromBuilder
(
this
.
RandomBuilder
.
bind
(
this
))
.
then
((
pixmap
:
image
.
PixelMap
)
{
.
then
((
pixmap
:
image
.
PixelMap
)
=>
{
this
.
pixmap
=
pixmap
this
.
pixmap
=
pixmap
// save pixmap to file
// save pixmap to file
// ....
// ....
})
})
})
})
}.
width
(
'
80%
'
).
margin
({
left
:
10
,
top
:
5
,
bottom
:
5
}).
height
(
200
)
}.
width
(
'
80%
'
).
margin
({
left
:
10
,
top
:
5
,
bottom
:
5
}).
height
(
200
)
.
border
({
color
:
'
#880606
'
,
width
:
2
})
.
border
({
color
:
'
#880606
'
,
width
:
2
})
...
...
zh-cn/application-dev/reference/apis/js-apis-arkui-drawableDescriptor.md
浏览文件 @
8c462a9f
...
@@ -32,16 +32,25 @@ constructor()
...
@@ -32,16 +32,25 @@ constructor()
当传入资源id或name为包含前景和背景资源的json文件时,生成LayeredDrawableDescriptor对象。
当传入资源id或name为包含前景和背景资源的json文件时,生成LayeredDrawableDescriptor对象。
**示例:**
**示例:**
```
js
```
ts
// xxx.ets
import
{
DrawableDescriptor
,
LayeredDrawableDescriptor
}
from
'
@ohos.arkui.drawableDescriptor
'
@
Entry
@
Entry
@
Component
@
Component
struct
Index
{
struct
Index
{
private
resManager
=
getContext
().
resourceManager
private
resManager
=
getContext
().
resourceManager
let
drawable1
=
resManager
.
getDrawableDescriptor
(
$r
(
'
app.media.icon
'
).
id
)
let
drawable2
=
resManager
.
getDrawableDescriptorByName
(
icon
)
build
()
{
let
layeredDrawable1
=
resManager
.
getDrawableDescriptor
(
$r
(
'
app.media.file
'
).
id
)
Row
()
{
let
layeredDrawable1
=
resManager
.
getDrawableDescriptor
(
file
)
Column
()
{
}
Image
((
<
LayeredDrawableDescriptor
>
(
this
.
resManager
.
getDrawableDescriptor
(
$r
(
'
app.media.icon
'
).
id
))))
Image
(((
<
LayeredDrawableDescriptor
>
(
this
.
resManager
.
getDrawableDescriptor
(
$r
(
'
app.media.icon
'
)
.
id
))).
getForeground
()).
getPixelMap
())
}.
height
(
'
50%
'
)
}.
width
(
'
50%
'
)
}
}
```
```
## DrawableDescriptor.getPixelMap
## DrawableDescriptor.getPixelMap
...
@@ -58,8 +67,8 @@ getPixelMap(): image.PixelMap;
...
@@ -58,8 +67,8 @@ getPixelMap(): image.PixelMap;
|
[
image.PixelMap
](
../apis/js-apis-image.md#pixelmap7
)
| PixelMap |
|
[
image.PixelMap
](
../apis/js-apis-image.md#pixelmap7
)
| PixelMap |
**示例:**
**示例:**
```
j
s
```
t
s
@
State
pixmap
:
PixelMap
=
drawable1
.
getPixelMap
();
pixmap
:
PixelMap
=
drawable1
.
getPixelMap
();
```
```
## LayeredDrawableDescriptor.getPixelMap
## LayeredDrawableDescriptor.getPixelMap
...
@@ -76,8 +85,8 @@ getPixelMap(): image.PixelMap;
...
@@ -76,8 +85,8 @@ getPixelMap(): image.PixelMap;
|
[
image.PixelMap
](
../apis/js-apis-image.md#pixelmap7
)
| PixelMap |
|
[
image.PixelMap
](
../apis/js-apis-image.md#pixelmap7
)
| PixelMap |
**示例:**
**示例:**
```
j
s
```
t
s
@
State
pixmap
:
PixelMap
=
layeredDrawable1
.
getPixelMap
();
pixmap
:
PixelMap
=
layeredDrawable1
.
getPixelMap
();
```
```
## LayeredDrawableDescriptor.getForeground
## LayeredDrawableDescriptor.getForeground
...
@@ -94,8 +103,8 @@ getForeground(): DrawableDescriptor;
...
@@ -94,8 +103,8 @@ getForeground(): DrawableDescriptor;
|
[
DrawableDescriptor
](
#drawabledescriptor
)
| DrawableDescriptor对象 |
|
[
DrawableDescriptor
](
#drawabledescriptor
)
| DrawableDescriptor对象 |
**示例:**
**示例:**
```
j
s
```
t
s
@
State
drawable
:
DrawableDescriptor
=
layeredDrawable1
.
getForeground
();
drawable
:
DrawableDescriptor
=
layeredDrawable1
.
getForeground
();
```
```
## LayeredDrawableDescriptor.getBackground
## LayeredDrawableDescriptor.getBackground
...
@@ -112,8 +121,8 @@ getBackground(): DrawableDescriptor;
...
@@ -112,8 +121,8 @@ getBackground(): DrawableDescriptor;
|
[
DrawableDescriptor
](
#drawabledescriptor
)
| DrawableDescriptor对象 |
|
[
DrawableDescriptor
](
#drawabledescriptor
)
| DrawableDescriptor对象 |
**示例:**
**示例:**
```
j
s
```
t
s
@
State
drawable
:
DrawableDescriptor
=
layeredDrawable1
.
getBackground
();
drawable
:
DrawableDescriptor
=
layeredDrawable1
.
getBackground
();
```
```
## LayeredDrawableDescriptor.getMask
## LayeredDrawableDescriptor.getMask
...
@@ -130,6 +139,6 @@ getMask(): DrawableDescriptor;
...
@@ -130,6 +139,6 @@ getMask(): DrawableDescriptor;
|
[
DrawableDescriptor
](
#drawabledescriptor
)
| DrawableDescriptor对象 |
|
[
DrawableDescriptor
](
#drawabledescriptor
)
| DrawableDescriptor对象 |
**示例:**
**示例:**
```
j
s
```
t
s
@
State
drawable
:
DrawableDescriptor
=
layeredDrawable1
.
getMask
();
drawable
:
DrawableDescriptor
=
layeredDrawable1
.
getMask
();
```
```
zh-cn/application-dev/reference/apis/js-apis-measure.md
浏览文件 @
8c462a9f
...
@@ -112,7 +112,7 @@ struct Index {
...
@@ -112,7 +112,7 @@ struct Index {
| 名称 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| -------------- | -------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------- |
| -------------- | -------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------- |
| textContent
| string | 是 | 设置被计算文本内容。 |
| textContent
<sup>
10+
</sup>
| string | 是 | 设置被计算文本内容。 |
| constraintWidth
<sup>
10+
</sup>
| number
\|
string
\|
[
Resource
](
../arkui-ts/ts-types.md#resource
)
| 否 | 设置被计算文本布局宽度。
<br/>
**说明:**
默认单位为vp |
| constraintWidth
<sup>
10+
</sup>
| number
\|
string
\|
[
Resource
](
../arkui-ts/ts-types.md#resource
)
| 否 | 设置被计算文本布局宽度。
<br/>
**说明:**
默认单位为vp |
| fontSize | number
\|
string
\|
[
Resource
](
../arkui-ts/ts-types.md#resource
)
| 否 | 设置被计算文本字体大小,fontSize为number类型时,使用fp单位。
<br/>
默认值:16fp。
<br/>
**说明:**
不支持设置百分比字符串。 |
| fontSize | number
\|
string
\|
[
Resource
](
../arkui-ts/ts-types.md#resource
)
| 否 | 设置被计算文本字体大小,fontSize为number类型时,使用fp单位。
<br/>
默认值:16fp。
<br/>
**说明:**
不支持设置百分比字符串。 |
| fontStyle | number
\|
[
FontStyle
](
../arkui-ts/ts-appendix-enums.md#fontstyle
)
| 否 | 设置被计算文本字体样式。
<br>
默认值:FontStyle.Normal |
| fontStyle | number
\|
[
FontStyle
](
../arkui-ts/ts-appendix-enums.md#fontstyle
)
| 否 | 设置被计算文本字体样式。
<br>
默认值:FontStyle.Normal |
...
...
zh-cn/application-dev/reference/apis/js-apis-plugincomponent.md
浏览文件 @
8c462a9f
...
@@ -155,11 +155,11 @@ OnPushEventCallback = (source: Want, template: PluginComponentTemplate, data: KV
...
@@ -155,11 +155,11 @@ OnPushEventCallback = (source: Want, template: PluginComponentTemplate, data: KV
```
js
```
js
function
onPushListener
(
source
,
template
,
data
,
extraData
)
{
function
onPushListener
(
source
,
template
,
data
,
extraData
)
{
console
.
log
(
"
onPushListener template.source=
"
+
template
.
source
)
console
.
log
(
"
onPushListener template.source=
"
+
template
.
source
)
console
.
log
(
"
onPushListener source=
"
+
JSON
.
stringify
(
source
))
console
.
log
(
"
onPushListener source=
"
+
JSON
.
stringify
(
source
))
console
.
log
(
"
onPushListener template=
"
+
JSON
.
stringify
(
template
))
console
.
log
(
"
onPushListener template=
"
+
JSON
.
stringify
(
template
))
console
.
log
(
"
onPushListener data=
"
+
JSON
.
stringify
(
data
))
console
.
log
(
"
onPushListener data=
"
+
JSON
.
stringify
(
data
))
console
.
log
(
"
onPushListener extraData=
"
+
JSON
.
stringify
(
extraData
))
console
.
log
(
"
onPushListener extraData=
"
+
JSON
.
stringify
(
extraData
))
}
}
```
```
...
@@ -181,14 +181,13 @@ OnRequestEventCallback = (source: Want, name: string, data: KVObject) => Request
...
@@ -181,14 +181,13 @@ OnRequestEventCallback = (source: Want, name: string, data: KVObject) => Request
**示例:**
**示例:**
```
js
```
js
function
onRequestListener
(
source
,
name
,
data
)
function
onRequestListener
(
source
,
name
,
data
)
{
{
console
.
error
(
"
onRequestListener
"
);
console
.
error
(
"
onRequestListener
"
);
console
.
log
(
"
onRequestListener source=
"
+
JSON
.
stringify
(
source
));
console
.
log
(
"
onRequestListener source=
"
+
JSON
.
stringify
(
source
));
console
.
log
(
"
onRequestListener name=
"
+
name
);
console
.
log
(
"
onRequestListener name=
"
+
name
);
console
.
log
(
"
onRequestListener data=
"
+
JSON
.
stringify
(
data
));
console
.
log
(
"
onRequestListener data=
"
+
JSON
.
stringify
(
data
));
return
{
template
:
"
ets/pages/plugin.js
"
,
data
:
data
};
return
{
template
:
"
ets/pages/plugin.js
"
,
data
:
data
};
}
}
```
```
...
@@ -210,24 +209,24 @@ push(param: PushParameters , callback: AsyncCallback<void>): void
...
@@ -210,24 +209,24 @@ push(param: PushParameters , callback: AsyncCallback<void>): void
```
js
```
js
pluginComponentManager
.
push
(
pluginComponentManager
.
push
(
{
{
want
:
{
want
:
{
bundleName
:
"
com.example.provider
"
,
bundleName
:
"
com.example.provider
"
,
abilityName
:
"
com.example.provider.MainAbility
"
,
abilityName
:
"
com.example.provider.MainAbility
"
,
},
},
name
:
"
plugintemplate
"
,
name
:
"
plugintemplate
"
,
data
:
{
data
:
{
"
key_1
"
:
"
plugin component test
"
,
"
key_1
"
:
"
plugin component test
"
,
"
key_2
"
:
34234
"
key_2
"
:
34234
},
},
extraData
:
{
extraData
:
{
"
extra_str
"
:
"
this is push event
"
"
extra_str
"
:
"
this is push event
"
},
},
jsonPath
:
""
,
jsonPath
:
""
,
},
},
(
err
,
data
)
=>
{
(
err
,
data
)
=>
{
console
.
log
(
"
push_callback: push ok!
"
);
console
.
log
(
"
push_callback: push ok!
"
);
}
}
)
)
```
```
...
@@ -251,30 +250,30 @@ push(param: PushParameterForStage, callback: AsyncCallback<void>): void
...
@@ -251,30 +250,30 @@ push(param: PushParameterForStage, callback: AsyncCallback<void>): void
```
js
```
js
pluginComponentManager
.
push
(
pluginComponentManager
.
push
(
{
{
owner
:{
owner
:
{
bundleName
:
"
com.example.provider
"
,
bundleName
:
"
com.example.provider
"
,
abilityName
:
"
com.example.provider.MainAbility
"
abilityName
:
"
com.example.provider.MainAbility
"
},
},
target
:
{
target
:
{
bundleName
:
"
com.example.provider
"
,
bundleName
:
"
com.example.provider
"
,
abilityName
:
"
com.example.provider.MainAbility
"
,
abilityName
:
"
com.example.provider.MainAbility
"
,
},
},
name
:
"
ets/pages/plugin2.js
"
,
name
:
"
ets/pages/plugin2.js
"
,
data
:
{
data
:
{
"
js
"
:
"
ets/pages/plugin.js
"
,
"
js
"
:
"
ets/pages/plugin.js
"
,
"
key_1
"
:
1111
,
,
"
key_1
"
:
1111
,
,
},
},
extraData
:
{
extraData
:
{
"
extra_str
"
:
"
this is push event
"
"
extra_str
"
:
"
this is push event
"
},
jsonPath
:
""
,
},
},
(
err
,
data
)
=>
{
jsonPath
:
""
,
console
.
log
(
"
push_callback:err:
"
,
JSON
.
stringify
(
err
));
},
console
.
log
(
"
push_callback:data:
"
,
JSON
.
stringify
(
data
));
(
err
,
data
)
=>
{
console
.
log
(
"
push_callback: push ok!
"
);
console
.
log
(
"
push_callback:err:
"
,
JSON
.
stringify
(
err
));
}
console
.
log
(
"
push_callback:data:
"
,
JSON
.
stringify
(
data
));
console
.
log
(
"
push_callback: push ok!
"
);
}
)
)
```
```
...
@@ -299,24 +298,24 @@ request(param: RequestParameters, callback: AsyncCallback<RequestCallbackPara
...
@@ -299,24 +298,24 @@ request(param: RequestParameters, callback: AsyncCallback<RequestCallbackPara
```
js
```
js
pluginComponentManager
.
request
(
pluginComponentManager
.
request
(
{
{
want
:
{
want
:
{
bundleName
:
"
com.example.provider
"
,
bundleName
:
"
com.example.provider
"
,
abilityName
:
"
com.example.provider.MainAbility
"
,
abilityName
:
"
com.example.provider.MainAbility
"
,
},
name
:
"
plugintemplate
"
,
data
:
{
"
key_1
"
:
"
plugin component test
"
,
"
key_2
"
:
1111111
},
jsonPath
:
""
,
},
},
(
err
,
data
)
=>
{
name
:
"
plugintemplate
"
,
console
.
log
(
"
request_callback: componentTemplate.ability=
"
+
data
.
componentTemplate
.
ability
)
data
:
{
console
.
log
(
"
request_callback: componentTemplate.source=
"
+
data
.
componentTemplate
.
source
)
"
key_1
"
:
"
plugin component test
"
,
console
.
log
(
"
request_callback: data=
"
+
JSON
.
stringify
(
data
.
data
))
"
key_2
"
:
1111111
console
.
log
(
"
request_callback: extraData=
"
+
JSON
.
stringify
(
data
.
extraData
))
},
}
jsonPath
:
""
,
},
(
err
,
data
)
=>
{
console
.
log
(
"
request_callback: componentTemplate.ability=
"
+
data
.
componentTemplate
.
ability
)
console
.
log
(
"
request_callback: componentTemplate.source=
"
+
data
.
componentTemplate
.
source
)
console
.
log
(
"
request_callback: data=
"
+
JSON
.
stringify
(
data
.
data
))
console
.
log
(
"
request_callback: extraData=
"
+
JSON
.
stringify
(
data
.
extraData
))
}
)
)
```
```
...
@@ -342,25 +341,25 @@ request(param: RequestParameterForStage, callback: AsyncCallback<RequestCallb
...
@@ -342,25 +341,25 @@ request(param: RequestParameterForStage, callback: AsyncCallback<RequestCallb
```
js
```
js
pluginComponentManager
.
request
(
pluginComponentManager
.
request
(
{
{
owner
:{
owner
:
{
bundleName
:
"
com.example.provider
"
,
bundleName
:
"
com.example.provider
"
,
abilityName
:
"
com.example.provider.MainAbility
"
abilityName
:
"
com.example.provider.MainAbility
"
},
},
target
:
{
target
:
{
bundleName
:
"
com.example.provider
"
,
bundleName
:
"
com.example.provider
"
,
abilityName
:
"
ets/pages/plugin2.js
"
,
abilityName
:
"
ets/pages/plugin2.js
"
,
},
name
:
"
plugintemplate
"
,
data
:
{
"
key_1
"
:
"
myapplication plugin component test
"
,
},
jsonPath
:
""
,
},
},
(
err
,
data
)
=>
{
name
:
"
plugintemplate
"
,
console
.
log
(
"
request_callback: componentTemplate.ability=
"
+
data
.
componentTemplate
.
ability
)
data
:
{
console
.
log
(
"
request_callback: componentTemplate.source=
"
+
data
.
componentTemplate
.
source
)
"
key_1
"
:
"
myapplication plugin component test
"
,
}
},
jsonPath
:
""
,
},
(
err
,
data
)
=>
{
console
.
log
(
"
request_callback: componentTemplate.ability=
"
+
data
.
componentTemplate
.
ability
)
console
.
log
(
"
request_callback: componentTemplate.source=
"
+
data
.
componentTemplate
.
source
)
}
)
)
```
```
...
@@ -381,8 +380,8 @@ on(eventType: string, callback: OnPushEventCallback | OnRequestEventCallback ):
...
@@ -381,8 +380,8 @@ on(eventType: string, callback: OnPushEventCallback | OnRequestEventCallback ):
**示例:**
**示例:**
```
js
```
js
pluginComponentManager
.
on
(
"
push
"
,
onPushListener
)
pluginComponentManager
.
on
(
"
push
"
,
onPushListener
)
pluginComponentManager
.
on
(
"
request
"
,
onRequestListener
)
pluginComponentManager
.
on
(
"
request
"
,
onRequestListener
)
```
```
## external.json文件说明
## external.json文件说明
...
@@ -396,3 +395,5 @@ external.json文件由开发者创建。external.json中以键值对形式存放
...
@@ -396,3 +395,5 @@ external.json文件由开发者创建。external.json中以键值对形式存放
"PluginProviderExample"
:
"ets/pages/PluginProviderExample.js"
,
"PluginProviderExample"
:
"ets/pages/PluginProviderExample.js"
,
"plugintemplate2"
:
"ets/pages/plugintemplate2.js"
"plugintemplate2"
:
"ets/pages/plugintemplate2.js"
}
}
```
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-router.md
浏览文件 @
8c462a9f
...
@@ -320,7 +320,7 @@ replaceUrl(options: RouterOptions, mode: RouterMode): Promise<void>
...
@@ -320,7 +320,7 @@ replaceUrl(options: RouterOptions, mode: RouterMode): Promise<void>
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| --------- | ------- |
| --------- | ------- |
| 100001 | if
UI execution context not found
, only throw in standard system. |
| 100001 | if
can not get the delegate
, only throw in standard system. |
| 200002 | if the uri is not exist. |
| 200002 | if the uri is not exist. |
**示例:**
**示例:**
...
@@ -362,7 +362,7 @@ replaceUrl(options: RouterOptions, mode: RouterMode, callback: AsyncCallback<
...
@@ -362,7 +362,7 @@ replaceUrl(options: RouterOptions, mode: RouterMode, callback: AsyncCallback<
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| --------- | ------- |
| --------- | ------- |
| 100001 | if
can not get the delegate
, only throw in standard system. |
| 100001 | if
UI execution context not found
, only throw in standard system. |
| 200002 | if the uri is not exist. |
| 200002 | if the uri is not exist. |
**示例:**
**示例:**
...
@@ -660,8 +660,8 @@ struct Second {
...
@@ -660,8 +660,8 @@ struct Second {
private
content
:
string
=
"
这是第二页
"
private
content
:
string
=
"
这是第二页
"
@
State
text
:
string
=
router
.
getParams
()[
'
text
'
]
@
State
text
:
string
=
router
.
getParams
()[
'
text
'
]
@
State
data
:
object
=
router
.
getParams
()[
'
data
'
]
@
State
data
:
object
=
router
.
getParams
()[
'
data
'
]
@
State
secondData
:
string
=
''
@
State
secondData
:
string
=
''
build
()
{
build
()
{
Flex
({
direction
:
FlexDirection
.
Column
,
alignItems
:
ItemAlign
.
Center
,
justifyContent
:
FlexAlign
.
Center
})
{
Flex
({
direction
:
FlexDirection
.
Column
,
alignItems
:
ItemAlign
.
Center
,
justifyContent
:
FlexAlign
.
Center
})
{
Text
(
`
${
this
.
content
}
`
)
Text
(
`
${
this
.
content
}
`
)
...
@@ -669,14 +669,14 @@ struct Second {
...
@@ -669,14 +669,14 @@ struct Second {
.
fontWeight
(
FontWeight
.
Bold
)
.
fontWeight
(
FontWeight
.
Bold
)
Text
(
this
.
text
)
Text
(
this
.
text
)
.
fontSize
(
30
)
.
fontSize
(
30
)
.
onClick
(()
=>
{
.
onClick
(()
=>
{
this
.
secondData
=
(
this
.
data
.[
'
array
'
][
1
]).
toString
()
this
.
secondData
=
(
this
.
data
.[
'
array
'
][
1
]).
toString
()
})
})
.
margin
({
top
:
20
})
.
margin
({
top
:
20
})
Text
(
`第一页传来的数值:
${
this
.
secondData
}
`
)
Text
(
`第一页传来的数值:
${
this
.
secondData
}
`
)
.
fontSize
(
20
)
.
fontSize
(
20
)
.
margin
({
top
:
20
})
.
margin
({
top
:
20
})
.
backgroundColor
(
'
red
'
)
.
backgroundColor
(
'
red
'
)
}
}
.
width
(
'
100%
'
)
.
width
(
'
100%
'
)
.
height
(
'
100%
'
)
.
height
(
'
100%
'
)
...
@@ -761,9 +761,9 @@ enableAlertBeforeBackPage(options: EnableAlertOptions): void
...
@@ -761,9 +761,9 @@ enableAlertBeforeBackPage(options: EnableAlertOptions): void
**示例:**
**示例:**
```
js
```
js
router
.
enableAlertBeforeBackPage
({
router
.
enableAlertBeforeBackPage
({
message
:
'
Message Info
'
message
:
'
Message Info
'
});
});
```
```
## router.disableAlertBeforeBackPage<sup>(deprecated)</sup>
## router.disableAlertBeforeBackPage<sup>(deprecated)</sup>
...
...
zh-cn/application-dev/reference/apis/js-apis-system-router.md
浏览文件 @
8c462a9f
...
@@ -341,8 +341,8 @@ export default {
...
@@ -341,8 +341,8 @@ export default {
| 名称 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| ------ | -------- | ---- | ------------------------------------------------------------ |
| ------ | -------- | ---- | ------------------------------------------------------------ |
| uri
| string | 是 | 目标页面的uri,可以是以下的两种格式:
<br/>
1. 页面的绝对路径,由config.json文件中的页面列表提供。例如:
<br/>
- pages/index/index
<br/>
-pages/detail/detail
<br/>
2. 特定路径。如果URI为斜杠(/),则显示主页。 |
| uri
<sup>
7+
</sup>
| string | 是 | 目标页面的uri,可以是以下的两种格式:
<br/>
1. 页面的绝对路径,由config.json文件中的页面列表提供。例如:
<br/>
- pages/index/index
<br/>
-pages/detail/detail
<br/>
2. 特定路径。如果URI为斜杠(/),则显示主页。 |
| params | object | 否 | 表示路由跳转时要同时传递到目标页面的数据。跳转到目标页面后,使用router.getParams()获取传递的参数,此外,在类web范式中,参数也可以在页面中直接使用,如this.keyValue(keyValue为跳转时params参数中的key值),如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 |
| params
<sup>
7+
</sup>
| object | 否 | 表示路由跳转时要同时传递到目标页面的数据。跳转到目标页面后,使用router.getParams()获取传递的参数,此外,在类web范式中,参数也可以在页面中直接使用,如this.keyValue(keyValue为跳转时params参数中的key值),如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 |
## BackRouterOptions
## BackRouterOptions
...
@@ -353,8 +353,8 @@ export default {
...
@@ -353,8 +353,8 @@ export default {
| 名称 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| ------ | -------- | ---- | ------------------------------------------------------------ |
| ------ | -------- | ---- | ------------------------------------------------------------ |
| uri
| string | 否 | 返回到指定uri的界面,如果页面栈上没有uri页面,则不响应该情况。如果uri未设置,则返回上一页。
<br>
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full |
| uri
<sup>
7+
</sup>
| string | 否 | 返回到指定uri的界面,如果页面栈上没有uri页面,则不响应该情况。如果uri未设置,则返回上一页。
<br>
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full |
| params | object | 否 | 跳转时要同时传递到目标页面的数据。
<br>
**系统能力:**
SystemCapability.ArkUI.ArkUI.Lite |
| params
<sup>
7+
</sup>
| object | 否 | 跳转时要同时传递到目标页面的数据。
<br>
**系统能力:**
SystemCapability.ArkUI.ArkUI.Lite |
## RouterState
## RouterState
...
...
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-sharp-clipping.md
浏览文件 @
8c462a9f
...
@@ -105,7 +105,7 @@ struct ClipAndMaskExample {
...
@@ -105,7 +105,7 @@ struct ClipAndMaskExample {
```
ts
```
ts
@
Entry
@
Entry
@
Component
@
Component
struct
ProgressMask
{
struct
ProgressMask
Example
{
@
State
progressflag1
:
boolean
=
true
;
@
State
progressflag1
:
boolean
=
true
;
@
State
color
:
Color
=
0x01006CDE
;
@
State
color
:
Color
=
0x01006CDE
;
@
State
value
:
number
=
10.0
;
@
State
value
:
number
=
10.0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录