From ac2da7968fdde138a86f8f2b6d9bdd8e292ae249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=91=AB?= Date: Wed, 14 Jun 2023 09:24:57 +0800 Subject: [PATCH] =?UTF-8?q?19521=E6=8C=91=E5=8D=95=20fix=20textfield=20doc?= =?UTF-8?q?=20default=20value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王鑫 --- .../arkui-ts/ts-basic-components-textarea.md | 16 ++++++++-------- .../arkui-ts/ts-basic-components-textinput.md | 9 ++++++++- 2 files changed, 16 insertions(+), 9 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 8b9d300af9..dbffc2b7ab 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 @@ -29,14 +29,14 @@ TextArea(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: Tex 除支持[通用属性](ts-universal-attributes-size.md)和[文本通用属性](ts-universal-attributes-text-style.md)的fontColor、fontSize、fontStyle、fontWeight、fontFamily外,还支持以下属性: -| 名称 | 参数类型 | 描述 | -| ------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| placeholderColor | [ResourceColor](ts-types.md#resourcecolor) | 设置placeholder文本颜色。
默认值跟随主题。 | -| placeholderFont | [Font](ts-types.md#font) | 设置placeholder文本样式,包括字体大小,字体粗细,字体族,字体风格。目前仅支持默认字体族。 | -| textAlign | [TextAlign](ts-appendix-enums.md#textalign) | 设置文本在输入框中的水平对齐方式。
默认值:TextAlign.Start
说明:
可通过[align](ts-universal-attributes-location.md)属性控制文本段落在垂直方向上的位置,此组件中不可通过align属性控制文本段落在水平方向上的位置,即align属性中Alignment.TopStart、Alignment.Top、Alignment.TopEnd效果相同,控制内容在顶部,Alignment.Start、Alignment.Center、Alignment.End效果相同,控制内容垂直居中,Alignment.BottomStart、Alignment.Bottom、Alignment.BottomEnd效果相同,控制内容在底部。 | -| caretColor | [ResourceColor](ts-types.md#resourcecolor) | 设置输入框光标颜色。
默认值:'#007DFF'。 | -| inputFilter8+ | {
value: [ResourceStr](ts-types.md#resourcestr),
error?: (value: string) => void
} | 通过正则表达式设置输入过滤器。匹配表达式的输入允许显示,不匹配的输入将被过滤。仅支持单个字符匹配,不支持字符串匹配。
- value:设置正则表达式。
- error:正则匹配失败时,返回被过滤的内容。 | -| copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | 设置输入的文本是否可复制。
默认值:CopyOptions.LocalDevice,支持设备内复制。
设置CopyOptions.None时,当前TextArea中的文字无法被复制或剪切,仅支持粘贴。 | +| 名称 | 参数类型 | 描述 | +| ------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| placeholderColor | [ResourceColor](ts-types.md#resourcecolor) | 设置placeholder文本颜色。
默认值跟随主题。 | +| placeholderFont | [Font](ts-types.md#font) | 设置placeholder文本样式,包括字体大小,字体粗细,字体族,字体风格。目前仅支持默认字体族。 | +| textAlign | [TextAlign](ts-appendix-enums.md#textalign) | 设置文本在输入框中的水平对齐方式。
默认值:TextAlign.Start
说明:
可通过[align](ts-universal-attributes-location.md)属性控制文本段落在垂直方向上的位置,此组件中不可通过align属性控制文本段落在水平方向上的位置,即align属性中Alignment.TopStart、Alignment.Top、Alignment.TopEnd效果相同,控制内容在顶部,Alignment.Start、Alignment.Center、Alignment.End效果相同,控制内容垂直居中,Alignment.BottomStart、Alignment.Bottom、Alignment.BottomEnd效果相同,控制内容在底部。 | +| caretColor | [ResourceColor](ts-types.md#resourcecolor) | 设置输入框光标颜色。
默认值:'#007DFF'。 | +| inputFilter8+ | {
value: [ResourceStr](ts-types.md#resourcestr),
error?: (value: string) => void
} | 通过正则表达式设置输入过滤器。匹配表达式的输入允许显示,不匹配的输入将被过滤。仅支持单个字符匹配,不支持字符串匹配。
- value:设置正则表达式。
- error:正则匹配失败时,返回被过滤的内容。 | +| copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | 设置输入的文本是否可复制。
默认值:CopyOptions.LocalDevice,支持设备内复制。
设置CopyOptions.None时,当前TextArea中的文字无法被复制或剪切,仅支持粘贴。 | | maxLength10+ | number | 设置文本的最大输入字符数。
默认不设置最大输入字符数限制。 | | showCounter10+ | boolean | 设置文本最大输入字符数后,是否显示字数。
默认值:false | | style10+ | [TextContentStyle](enums.d.ts#TextContentStyle) | 设置文本框多态样式。
默认值:TextContentStyle.DEFAULT | 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 7dfdf5a6e0..00b6c55fd7 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 @@ -40,7 +40,7 @@ TextInput(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: Te | inputFilter8+ | {
value: [ResourceStr](ts-types.md#resourcestr),
error?: (value: string) => void
} | 正则表达式,匹配表达式的输入允许显示,不匹配的输入将被过滤。目前仅支持单个字符匹配,不支持字符串匹配。
- value:设置正则表达式。
- error:正则匹配失败时,返回被过滤的内容。 | | copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | 设置输入的文本是否可复制。
默认值:CopyOptions.LocalDevice,支持设备内复制。
设置CopyOptions.None时,当前TextInput中的文字无法被复制或剪切,仅支持粘贴。 | | showPasswordIcon9+ | boolean | 密码输入模式时,输入框末尾的图标是否显示。
默认值:true | -| style9+ | [TextInputStyle](#textinputstyle9枚举说明) | 设置输入框为默认风格或内联输入风格。
默认值:TextInputStyle.Default | +| style9+ | [TextInputStyle](#textinputstyle9枚举说明) \| [TextContentStyle](enums.d.ts#TextContentStyle) | 设置输入框为默认风格或内联输入风格。
默认值:TextInputStyle.Default | | textAlign9+ | [TextAlign](ts-appendix-enums.md#textalign) | 设置文本在输入框中的水平对齐方式。
默认值:TextAlign.Start
说明:
可通过[align](ts-universal-attributes-location.md)属性控制文本段落在垂直方向上的位置,此组件中不可通过align属性控制文本段落在水平方向上的位置,即align属性中Alignment.TopStart、Alignment.Top、Alignment.TopEnd效果相同,控制内容在顶部,Alignment.Start、Alignment.Center、Alignment.End效果相同,控制内容垂直居中,Alignment.BottomStart、Alignment.Bottom、Alignment.BottomEnd效果相同,控制内容在底部。 | | selectedBackgroundColor10+ | [ResourceColor](ts-types.md#resourcecolor) | 设置文本选中底板颜色。
如果未设置透明度,默认为不透明(例如:“0x80000000”为50%透明度黑色)。 | | caretStyle10+ | {
width: [Length](ts-types.md#length)
} | 设置光标风格。 | @@ -81,6 +81,13 @@ TextInput(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: Te | Default | 默认风格,光标宽1.5vp,光标高度与文本选中底板高度和字体大小相关。 | | Inline | 内联输入风格。文本选中底板高度与输入框高度相同。 | +## PasswordIcon10+对象说明 + +| 名称 | 类型 | 必填 | 描述 | +| ---------- | -------------------------------------------------- | ---- | -------------------------------------------------- | +| onIconSrc | string \|[Resource](ts-types.md#resource类型) | 否 | 密码输入模式时,能够切换密码隐藏的显示状态的图标。 | +| offIconSrc | string \|[Resource](ts-types.md#resource类型) | 否 | 密码输入模式时,能够切换密码显示的隐藏状态的图标。 | + ## 事件 除支持[通用事件](ts-universal-events-click.md)外,还支持以下事件: -- GitLab