提交 a13c0e65 编写于 作者: L limeng

the initial commit for setTextSelection

Signed-off-by: Nlimeng <limeng208@huawei.com>
上级 cd50a26f
...@@ -81,14 +81,14 @@ caretPosition(value: number): void ...@@ -81,14 +81,14 @@ caretPosition(value: number): void
setTextSelection(selectionStart: number, selectionEnd: number): void setTextSelection(selectionStart: number, selectionEnd: number): void
设置文本选择范围 组件在获焦状态下,调用该接口设置文本选择区域并高亮显示。<br/>当接口入参(selectionStart或selectionEnd)小于0时、按照0处理;当接口入参大于文字最大长度时、按照文字最大长度处理。<br/>只有在selectionStart小于selectionEnd时,文字才会被选取、高亮显示
**参数:** **参数:**
| 参数名 | 参数类型 | 必填 | 参数描述 | | 参数名 | 参数类型 | 必填 | 参数描述 |
| -------------- | -------- | ---- | ------------------ | | -------------- | -------- | ---- | ------------------ |
| selectionStart | number | 是 | 选择范围起始位置。 | | selectionStart | number | 是 | 文本选择区域起始位置,文本框中文字的起始位置为0。 |
| selectionEnd | number | 是 | 选择范围结束位置。 | | selectionEnd | number | 是 | 文本选择区域结束位置。 |
## 示例 ## 示例
...@@ -130,4 +130,4 @@ struct TextAreaExample { ...@@ -130,4 +130,4 @@ struct TextAreaExample {
} }
``` ```
![textArea](figures/textArea.gif) ![textArea](figures/textArea.gif)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册