From c74daa5b40fedddba2dec5e0f9ae9642b71a07b3 Mon Sep 17 00:00:00 2001 From: xiexiyun Date: Fri, 31 Mar 2023 18:24:41 +0800 Subject: [PATCH] add description for textinput refresh scene Signed-off-by: xiexiyun Change-Id: I3a4ca17c3af02a7bb0956208592e7e3cd4682a68 --- .../reference/arkui-ts/ts-basic-components-textarea.md | 5 +++-- .../reference/arkui-ts/ts-basic-components-textinput.md | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md index 0389e734d0..422eba6537 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md @@ -20,8 +20,8 @@ TextArea(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: Tex | 参数名 | 参数类型 | 必填 | 参数描述 | | ----------------------- | ---------------------------------------- | ---- | -------------- | -| placeholder | [ResourceStr](ts-types.md#resourcestr) | 否 | 设置无输入时的提示文本,输入内容后,提示文本不显示。 | -| text | [ResourceStr](ts-types.md#resourcestr) | 否 | 设置输入框当前的文本内容。 | +| placeholder | [ResourceStr](ts-types.md#resourcestr) | 否 | 设置无输入时的提示文本。输入内容后,提示文本不显示。 | +| text | [ResourceStr](ts-types.md#resourcestr) | 否 | 设置输入框当前的文本内容。
当组件设置[stateStyles](ts-universal-attributes-polymorphic-style.md)等刷新属性时,建议通过onChange事件将状态变量与文本实时绑定,
避免组件刷新时TextArea中的文本内容异常。 | | controller8+ | [TextAreaController](#textareacontroller8) | 否 | 设置TextArea控制器。 | @@ -102,6 +102,7 @@ struct TextAreaExample { build() { Column() { TextArea({ + text: this.text, placeholder: 'The text area can hold an unlimited amount of text. input your word...', controller: this.controller }) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md index c266cfa766..ffa80febf3 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md @@ -21,7 +21,7 @@ TextInput(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: Te | 参数名 | 参数类型 | 必填 | 参数描述 | | ----------------------- | ---------------------------------------- | ---- | --------------- | | placeholder | [ResourceStr](ts-types.md#resourcestr) | 否 | 设置无输入时的提示文本。 | -| text | [ResourceStr](ts-types.md#resourcestr) | 否 | 设置输入框当前的文本内容。 | +| text | [ResourceStr](ts-types.md#resourcestr) | 否 | 设置输入框当前的文本内容。
当组件设置[stateStyles](ts-universal-attributes-polymorphic-style.md)等刷新属性时,建议通过onChange事件将状态变量与文本实时绑定,
避免组件刷新时TextInput中的文本内容异常。 | | controller8+ | [TextInputController](#textinputcontroller8) | 否 | 设置TextInput控制器。 | @@ -135,7 +135,7 @@ struct TextInputExample { build() { Column() { - TextInput({ placeholder: 'input your word...', controller: this.controller }) + TextInput({ text: this.text, placeholder: 'input your word...', controller: this.controller }) .placeholderColor(Color.Grey) .placeholderFont({ size: 14, weight: 400 }) .caretColor(Color.Blue) -- GitLab