Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可不可以加一个 获取当前选择的文本的方法呢 #425

Closed
Roaming-l opened this issue Jan 11, 2024 · 5 comments
Closed

可不可以加一个 获取当前选择的文本的方法呢 #425

Roaming-l opened this issue Jan 11, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@Roaming-l
Copy link

一个很棒的想法

想基于现有版本实现一个选中内容翻译的功能,目前没有找到可以获取当前选中文本的方法,请问有其他的方法吗

@imzbf
Copy link
Owner

imzbf commented Jan 12, 2024

可以的,预计会通过组件实例来调用

const selectedText = editorRef.value?.xxx() // 待定

@imzbf imzbf self-assigned this Jan 12, 2024
@imzbf imzbf added the enhancement New feature or request label Jan 12, 2024
@Roaming-l
Copy link
Author

好的 期待作者后续的更新,目前还发现了一个问题,在4.10版本中,自定义扩展的组件 targetValue: ==${translateForm.result}==,
select: false,
deviationStart: 0,
deviationEnd: 0, 配置以后 还是默认对值进行选中了,不知道是配置的问题呢还是?
uTools_1705067325033

@Roaming-l
Copy link
Author

deviationend设置成1就可以了,在4.8版本没有这个问题,是后续加了校验了吗

@imzbf
Copy link
Owner

imzbf commented Jan 15, 2024

好的 期待作者后续的更新,目前还发现了一个问题,在4.10版本中,自定义扩展的组件 targetValue: ==${translateForm.result}==, select: false, deviationStart: 0, deviationEnd: 0, 配置以后 还是默认对值进行选中了,不知道是配置的问题呢还是? uTools_1705067325033

这看起来是个BUG

@imzbf
Copy link
Owner

imzbf commented Jan 18, 2024

4.11.0提供了getSelectedText来获取选中的内容

@imzbf imzbf closed this as completed Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants