提交 9993c736 编写于 作者: Z zaki

update sample codes in accessibility-extension-context.md

Signed-off-by: Nzaki <zhoujun141@huawei.com>
Change-Id: Iff21893f74570735e3d694932aa413f35e72ba1b
上级 100c7e01
......@@ -244,6 +244,7 @@ getFocusElement(isAccessibilityFocus: boolean, callback: AsyncCallback\<Accessib
```ts
let focusElement;
let isAccessibilityFocus = true;
try {
axContext.getFocusElement(isAccessibilityFocus, (err, data) => {
if (err) {
......@@ -368,6 +369,7 @@ getWindowRootElement(windowId: number, callback: AsyncCallback\<AccessibilityEle
```ts
let rootElement;
let windowId = 10;
try {
axContext.getWindowRootElement(windowId, (err, data) => {
if (err) {
......@@ -698,7 +700,7 @@ let rootElement;
try {
rootElement.attributeValue(attributeName).then((data) => {
console.log('get attribute value by name success');
attribtueValue = data;
attributeValue = data;
}).catch((err) => {
console.log('failed to get attribute value, because ' + JSON.stringify(err));
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册