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

The addItem interface of the frontend API Menu supports to pass in the DOM element #8343

Closed
svchord opened this issue May 23, 2023 · 3 comments
Assignees
Milestone

Comments

@svchord
Copy link

svchord commented May 23, 2023

Menu 的 addItem 接口希望可以传入自己创建的DOM元素

In what scenarios do you need this feature?

希望利用Menu浮层显示自己创建的界面,虽然热力图、闪卡增强等插件能通过一些偏门手段实现这一点,但这也说明了是有需求的,所以希望官方能够提供比较方便的方法。

Describe the optimal solution

addItem接口可以传入IMenuItemOption类型或者HTMLElement类型的参数

Describe the candidate solution

No response

Other information

No response

@88250 88250 changed the title Menu 的 addItem 接口希望可以传入自己创建的DOM元素 The addItem interface of the frontend API Menu supports to pass in the DOM element May 24, 2023
@Vanessa219
Copy link
Member

你看一下这样是否满足需求
image

@svchord
Copy link
Author

svchord commented May 24, 2023

一定要传模板字符串吗,能不能直接传HTMLElement类型

@Vanessa219
Copy link
Member

字符串都可以,element 只是没有接口,稍等我去添加一下。

@Vanessa219 Vanessa219 reopened this May 25, 2023
@Vanessa219 Vanessa219 self-assigned this May 25, 2023
@Vanessa219 Vanessa219 added this to the 2.8.10 milestone May 25, 2023
Vanessa219 added a commit to siyuan-note/plugin-sample that referenced this issue May 25, 2023
Vanessa219 added a commit that referenced this issue May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants