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

元素支持悬浮提示 #762

Open
bettersoft123 opened this issue Aug 15, 2024 · 6 comments
Open

元素支持悬浮提示 #762

bettersoft123 opened this issue Aug 15, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@bettersoft123
Copy link

What problem does this feature solve?

在编辑文档过程中,有些元素需要提醒如何填写,能后在录入过程中,光标聚焦的时候自动弹出hint提示框?或者鼠标移动到控件上提示。离开的时候恢复。

What does the proposed API look like?

如上

@daria2023
Copy link
Contributor

instance.eventBus.on('controlChange', (payload: IControl | null) => void)
instance.eventBus.on('mouseenter', (evt: MouseEvent) => void)
可以去文档看一下:https://github.com/Hufe921/canvas-editor/blob/main/docs/guide/listener.md

@bettersoft123
Copy link
Author

instance.eventBus.on('controlChange', (payload: IControl | null) => void)
instance.eventBus.on('mouseenter', (evt: MouseEvent) => void) 这是两个监听方法啊,我是想在控件的上方或者旁边,有hint提示,这个怎么实现哩?谢谢。

@daria2023
Copy link
Contributor

controlChange给你返回了IControl,你可以这获取到控件的信息,在结合range去获取当前位置,去做一个绝对定位的信息提示,你可以参考一下hyperlink是怎么实现点击后显示跳转网址的。

@bettersoft123
Copy link
Author

这个必须要改源码才行吧?不改源码没法实现吧?

@Hufe921
Copy link
Owner

Hufe921 commented Aug 16, 2024

#739
暂时可以参考这个示例实现,考虑后续内部支持提示可选

@Hufe921 Hufe921 changed the title 在元素控件聚焦或者鼠标点击时能否弹出hint提示? 元素支持悬浮提示 Aug 16, 2024
@Hufe921 Hufe921 added the enhancement New feature or request label Aug 16, 2024
@bettersoft123
Copy link
Author

我在参考楼上博主的实现方法,再改您的源码,感觉有难度。希望能加上去哈。这个在做EMR的时候还是很有价值的。谢谢您。如果您方便的话,加下QQ群935536135,有几十个您的忠粉。希望能得到您的帮助,也能让canvas-editor走的更远。谢谢。

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

3 participants