未验证 提交 772053f2 编写于 作者: O openharmony_ci 提交者: Gitee

!14019 翻译完成 13830: ts-universal-attributes-focus.md

Merge pull request !14019 from ester.zhou/TR-13830
...@@ -201,7 +201,7 @@ Sample code for **focusControl.requestFocus**: ...@@ -201,7 +201,7 @@ Sample code for **focusControl.requestFocus**:
Use the **focusContrl.requestFocus** API to enable a specified component to obtain focus. Use the **focusContrl.requestFocus** API to enable a specified component to obtain focus.
```ts ```ts
// requestFocus.ets // requestFocus.ets
import prompt from '@ohos.prompt' import promptAction from '@ohos.promptAction';
@Entry @Entry
@Component @Component
...@@ -253,9 +253,9 @@ struct RequestFocusExample { ...@@ -253,9 +253,9 @@ struct RequestFocusExample {
.onClick(() => { .onClick(() => {
var res = focusControl.requestFocus(this.selectId) // Enable the component selected by this.selectId to obtain focus. var res = focusControl.requestFocus(this.selectId) // Enable the component selected by this.selectId to obtain focus.
if (res) { if (res) {
prompt.showToast({message: 'Request success'}) promptAction.showToast({message: 'Request success'})
} else { } else {
prompt.showToast({message: 'Request failed'}) promptAction.showToast({message: 'Request failed'})
} }
}) })
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册