ShareMenu
ShareMenu 类在 macOS 上创建 共享菜单,可用于将当前上下文的信息共享到应用、社交媒体账户及其他服务。
🌐 The ShareMenu class creates Share Menu on macOS, which can be
used to share information from the current context to apps, social media
accounts, and other services.
要将共享菜单作为其他菜单的子菜单,请使用MenuItem 的 shareMenu 角色。
🌐 For including the share menu as a submenu of other menus, please use the
shareMenu role of MenuItem.
类:ShareMenu
🌐 Class: ShareMenu
History
| Version(s) | Changes |
|---|---|
None | API ADDED |
在 macOS 上创建共享菜单。
进程:主进程
🌐 Process: Main
Electron 内置的类不能在用户代码中被继承。 欲了解更多信息,请参见 常见问题。
new ShareMenu(sharingItem)
sharingItem共享项 - 要共享的项目。
创建新的共享菜单。
🌐 Creates a new share menu.
实例方法
🌐 Instance Methods
shareMenu 对象具有以下实例方法:
🌐 The shareMenu object has the following instance methods:
shareMenu.popup([options])
在 BrowserWindow 中以上下文菜单的形式弹出此菜单。
🌐 Pops up this menu as a context menu in the BrowserWindow.
shareMenu.closePopup([browserWindow])
browserWindow浏览器窗口(可选)- 默认是当前聚焦的窗口。
关闭 browserWindow 中的上下文菜单。
🌐 Closes the context menu in the browserWindow.