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

如何动态的更改菜单 #32

Open
zhandouxiaojiji opened this issue Oct 14, 2020 · 0 comments
Open

如何动态的更改菜单 #32

zhandouxiaojiji opened this issue Oct 14, 2020 · 0 comments

Comments

@zhandouxiaojiji
Copy link

我试了下直接获取菜单项去修改

const item = Menu.getApplicationMenu().getMenuItemById("xxx");
item.label = "test";
item.enabled = false;

似乎只是下面那个enabled的设置有效(变灰),但是label的修改并没有生效
请教一下大佬,除了重建整个ApplicationMenu,还有没有比较优雅的实现方式。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant