Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
06964e28
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
06964e28
编写于
5月 27, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 27, 2023
浏览文件
操作
浏览文件
下载
差异文件
!18699 【ace_engine_standard部件】textarea文字实现选中指定光标起始位置文字功能
Merge pull request !18699 from limeng/textarea_setTextSelection
上级
c1182727
c751a06d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
6 deletion
+6
-6
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md
...on-dev/reference/arkui-ts/ts-basic-components-textarea.md
+6
-6
未找到文件。
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md
浏览文件 @
06964e28
...
...
@@ -81,14 +81,14 @@ caretPosition(value: number): void
setTextSelection(selectionStart: number, selectionEnd: number): void
设置文本选择范围
。
组件在获焦状态下,调用该接口设置文本选择区域并高亮显示,且只有在selectionStart小于selectionEnd时,文字才会被选取、高亮显示
。
**参数:**
| 参数名 | 参数类型 | 必填 | 参数描述 |
| -------------- | -------- | ---- | ------------------ |
| selectionStart | number | 是 |
选择范围起始位置。
|
| selectionEnd | number | 是 |
选择范围结束位置。
|
| 参数名 | 参数类型 | 必填 | 参数描述
|
| -------------- | -------- | ---- | ------------------
------------------------------------------
|
| selectionStart | number | 是 |
文本选择区域起始位置,文本框中文字的起始位置为0。
<br/>
当selectionStart小于0时、按照0处理;当selectionStart大于文字最大长度时、按照文字最大长度处理。
<br/>
|
| selectionEnd | number | 是 |
文本选择区域结束位置。
<br/>
当selectionEnd小于0时、按照0处理;当selectionEnd大于文字最大长度时、按照文字最大长度处理。
<br/>
|
## 示例
...
...
@@ -130,4 +130,4 @@ struct TextAreaExample {
}
```
![
textArea
](
figures/textArea.gif
)
\ No newline at end of file
![
textArea
](
figures/textArea.gif
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录