未验证 提交 7bda40c8 编写于 作者: O openharmony_ci 提交者: Gitee

!8354 修复search文档示例输入文字后原先的内容被刷新为空

Merge pull request !8354 from xiexiyun/textinput
...@@ -85,21 +85,22 @@ struct SearchExample { ...@@ -85,21 +85,22 @@ struct SearchExample {
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text(this.submitvalue) Text(this.submitvalue)
Text(this.changevalue) Text(this.changevalue)
Search({value: '', placeholder: 'Type to search', controller: this.controller}) Search({value: this.changevalue, placeholder: 'Type to search', controller: this.controller})
.searchButton('Search') .searchButton('Search')
.width(400) .width(400)
.height(35) .height(35)
.backgroundColor(Color.White) .backgroundColor(Color.White)
.placeholderColor(Color.Grey) .placeholderColor(Color.Grey)
.placeholderFont({ size: 50, weight: 10, family: 'serif', style: FontStyle.Normal }) .placeholderFont({ size: 26, weight: 10, family: 'serif', style: FontStyle.Normal })
.onSubmit((value: string) => { .onSubmit((value: string) => {
this.submitvalue = value this.submitvalue = value
}) })
.onChange((value: string) => { .onChange((value: string) => {
this.changevalue = value this.changevalue += value
}) })
.margin({ top: 30 }) .margin({ top: 30, left:10, right:10 })
} }
} }
} }
``` ```
![search](figures/search.png)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册