跳到主内容

类: TouchBarSlider

类: TouchBarSlider

为本机 macOS 应用程序在触摸栏中创建滑块

Process: Main
此类不从 'electron' 模块导出. 它只能作为Electron API中其他方法的返回值。

new TouchBarSlider(options)

  • 选项 对象
    • label String (可选) - 标签文本.
    • value Integer (可选) - 选中值.
    • minValue Integer (可选) - 最小值.
    • maxValue Integer (可选) - 最大值.
    • change Function (optional) - Function to call when the slider is changed.
      • newValue Number - 用户选中的值.

实例属性

以下为 TouchBarSlider 实例的可用属性:

touchBarSlider.label

A String representing the slider's current text. Changing this value immediately updates the slider in the touch bar.

touchBarSlider.value

A Number representing the slider's current value. Changing this value immediately updates the slider in the touch bar.

touchBarSlider.minValue

A Number representing the slider's current minimum value. Changing this value immediately updates the slider in the touch bar.

touchBarSlider.maxValue

A Number representing the slider's current maximum value. Changing this value immediately updates the slider in the touch bar.