跳转到主要内容

类:TouchBarPopover

Class: TouchBarPopover

为原生的 macOS 应用程序创建触摸栏弹出窗口

进程:主进程
此类未从 'electron' 模块导出。它仅作为 Electron API 中其他方法的返回值可用。

new TouchBarPopover(options)

  • options Object
    • label string (可选) - 弹出窗口按钮文本。
    • icon NativeImage (可选) - 弹出窗口按钮图标。
    • items TouchBar - 要在弹出窗口中显示的项。
    • showCloseButton boolean (可选) - true 显示弹出窗口左侧的关闭按钮,false 不显示。默认为 true

实例属性

TouchBarPopover 实例上有以下属性可用

touchBarPopover.label

表示弹出窗口当前按钮文本的 string。更改此值将立即更新触摸栏中的弹出窗口。

touchBarPopover.icon

表示弹出窗口当前按钮图标的 NativeImage。更改此值将立即更新触摸栏中的弹出窗口。