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
在 macOS 上创建共享菜单。
¥Create share menu on macOS.
进程:主进程
¥Process: Main
[!警告] Electron 的内置类无法在用户代码中进行子类化。更多信息,请参阅 常见问题解答。
¥[!WARNING] Electron's built-in classes cannot be subclassed in user code. For more information, see the FAQ.
new ShareMenu(sharingItem)
-
sharingItemSharingItem - 要分享的项目。¥
sharingItemSharingItem - The item to share.
创建新的共享菜单。
¥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])
-
browserWindowBrowserWindow(可选) - 默认是聚焦窗口。¥
browserWindowBrowserWindow (optional) - Default is the focused window.
关闭 browserWindow 中的上下文菜单。
¥Closes the context menu in the browserWindow.