# ks.getSelectedTextRange

在 input、textarea 等 focus 之后,获取输入框的光标位置。注意:只有在 focus 的时候调用此接口才有效。

# getSelectedTextRange(options?: GetSelectedTextRangeOptions): Promise<SelectedTextRange>

# 参数

参数 类型 必填
options GetSelectedTextRangeOptions

# GetSelectedTextRangeOptions

属性
属性 类型 必填 说明
success (result: SelectedTextRange) => void 接口调用成功的回调函数
fail (error: APIError) => void 接口调用失败的回调函数
complete (resultOrError: SelectedTextRange | APIError) => void 接口调用结束的回调函数(调用成功、失败都会执行)

# 返回值

# Promise<SelectedTextRange>

SelectedTextRange
属性
属性 类型 说明
start number 输入框光标起始位置
end number 输入框光标结束位置
Copyright ©2024, All Rights Reserved