Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
d190b8de
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,发现更多精彩内容 >>
未验证
提交
d190b8de
编写于
11月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!11638 修复无障碍子系统文档中的示例代码问题
Merge pull request !11638 from zaki/master
上级
6e9991ab
c4c91b97
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
4 deletion
+14
-4
zh-cn/application-dev/reference/apis/js-apis-accessibility-config.md
...cation-dev/reference/apis/js-apis-accessibility-config.md
+2
-0
zh-cn/application-dev/reference/apis/js-apis-accessibility-extension-context.md
...reference/apis/js-apis-accessibility-extension-context.md
+12
-4
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-accessibility-config.md
浏览文件 @
d190b8de
...
...
@@ -64,6 +64,7 @@ enableAbility(name: string, capability: Array<accessibility.Capability>):
**示例:**
```
ts
import
accessibility
from
'
@ohos.accessibility
'
;
let
name
=
'
com.ohos.example/axExtension
'
;
let
capability
:
accessibility
.
Capability
[]
=
[
'
retrieve
'
];
try
{
...
...
@@ -105,6 +106,7 @@ enableAbility(name: string, capability: Array<accessibility.Capability>, c
**示例:**
```
ts
import
accessibility
from
'
@ohos.accessibility
'
;
let
name
=
'
com.ohos.example/axExtension
'
;
let
capability
:
accessibility
.
Capability
[]
=
[
'
retrieve
'
];
try
{
...
...
zh-cn/application-dev/reference/apis/js-apis-accessibility-extension-context.md
浏览文件 @
d190b8de
...
...
@@ -210,6 +210,7 @@ getFocusElement(callback: AsyncCallback\<AccessibilityElement>): void;
**示例:**
```
ts
let
focusElement
;
try
{
axContext
.
getFocusElement
((
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -242,6 +243,7 @@ getFocusElement(isAccessibilityFocus: boolean, callback: AsyncCallback\<Accessib
**示例:**
```
ts
let
focusElement
;
try
{
axContext
.
getFocusElement
(
isAccessibilityFocus
,
(
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -324,6 +326,7 @@ getWindowRootElement(callback: AsyncCallback\<AccessibilityElement>): void;
**示例:**
```
ts
let
rootElement
;
try
{
axContext
.
getWindowRootElement
((
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -364,6 +367,7 @@ getWindowRootElement(windowId: number, callback: AsyncCallback\<AccessibilityEle
**示例:**
```
ts
let
rootElement
;
try
{
axContext
.
getWindowRootElement
(
windowId
,
(
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -536,10 +540,11 @@ injectGesture(gesturePath: GesturePath): Promise\<void>;
```
ts
import
GesturePath
from
"
@ohos.accessibility.GesturePath
"
;
let
gesturePath
=
new
GesturePath
(
100
);
import
GesturePoint
from
'
@ohos.accessibility.GesturePoint
'
;
let
gesturePath
=
new
GesturePath
.
GesturePath
(
100
);
try
{
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
let
gesturePoint
=
new
GesturePoint
(
100
,
i
*
200
);
let
gesturePoint
=
new
GesturePoint
.
GesturePoint
(
100
,
i
*
200
);
gesturePath
.
points
.
push
(
gesturePoint
);
}
axContext
.
injectGesture
(
gesturePath
).
then
(()
=>
{
...
...
@@ -578,10 +583,11 @@ injectGesture(gesturePath: GesturePath, callback: AsyncCallback\<void>): void
```
ts
import
GesturePath
from
"
@ohos.accessibility.GesturePath
"
;
let
gesturePath
=
new
GesturePath
(
100
);
import
GesturePoint
from
'
@ohos.accessibility.GesturePoint
'
;
let
gesturePath
=
new
GesturePath
.
GesturePath
(
100
);
try
{
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
let
gesturePoint
=
new
GesturePoint
(
100
,
i
*
200
);
let
gesturePoint
=
new
GesturePoint
.
GesturePoint
(
100
,
i
*
200
);
gesturePath
.
points
.
push
(
gesturePoint
);
}
axContext
.
injectGesture
(
gesturePath
,
(
err
,
data
)
=>
{
...
...
@@ -687,6 +693,8 @@ attributeValue\<T extends keyof ElementAttributeValues>(attributeName: T): Promi
```
ts
let
attributeName
=
'
name
'
;
let
attributeValue
;
let
rootElement
;
try
{
rootElement
.
attributeValue
(
attributeName
).
then
((
data
)
=>
{
console
.
log
(
'
get attribute value by name success
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录