From 8348e0033fadf27a89d37ca0e9080db64aebb84d Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Mon, 8 Aug 2022 12:18:37 +0800 Subject: [PATCH] update ts-basic-components-textinput.md (6632) Signed-off-by: ester.zhou --- .../arkui-ts/ts-basic-components-textinput.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md b/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md index 9a201318f8..32943429e6 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md @@ -1,13 +1,12 @@ # TextInput +The **\** component provides single-line text input and is able to respond to input events. + > **NOTE** > > This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. -The **\** component provides single-line text input. - - ## Required Permissions None @@ -20,23 +19,24 @@ Not supported ## APIs -TextInput(value?:{placeholder?: string controller?: TextInputController}) +TextInput(value?:{placeholder?: string | Resource, text?: string | Resource, controller?: TextInputController}) - Parameters | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | - | placeholder | string | No | - | Text displayed when there is no input. | + | placeholder | string \| [Resource](../../ui/ts-types.md) | No | - | Hint text displayed when there is no input. | + | text | string \| [Resource](../../ui/ts-types.md) | No | - | Current text input. | | controller8+ | [TextInputController](#textinputcontroller8) | No | - | Text input controller. | ## Attributes -In addition to universal attributes, the following attributes are supported. +In addition to the universal attributes, the following attributes are supported. | Name | Type | Default Value | Description | | -------- | -------- | -------- | -------- | | type | InputType | InputType.Normal | Input box type. | -| placeholderColor | Color | - | Placeholder color. | +| placeholderColor | Color | - | Placeholder text color. | | placeholderFont | {
size?: Length,
weight?: number\|[FontWeight](ts-universal-attributes-text-style.md),
family?: string,
style?: [FontStyle](ts-universal-attributes-text-style.md)
} | - | Placeholder text style.
- **size**: font size. If the value is of the number type, the unit fp is used.
- **weight**: font weight. For the number type, the value ranges from 100 to 900, at an interval of 100. The default value is **400**. A larger value indicates a larger font weight.
- **family**: font family. Use commas (,) to separate multiple fonts, for example, **'Arial, sans-serif'**. The priority of the fonts is the sequence in which they are placed.
- **style**: font style. | | enterKeyType | EnterKeyType | EnterKeyType.Done | How the Enter key is labeled. | | caretColor | Color | - | Color of the caret (also known as the text insertion cursor). | -- GitLab