Skip to main content

类:TouchBarSlider

类:TouchBarSlider

🌐 Class: TouchBarSlider

在触控栏为原生 macOS 应用创建滑块

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

new TouchBarSlider(options)

  • options 对象
    • label string(optional)- 标签文本。
    • value Integer(optional)- 已选择的值。
    • minValue Integer(optional)- 最小值。
    • maxValue Integer(optional)- 最大值
    • change Function(optional)- 滑块更改时调用的函数。
      • newValue number - 用户在滑块上选择的值。

实例属性

🌐 Instance Properties

TouchBarSlider 实例上可用的属性如下:

🌐 The following properties are available on instances of TouchBarSlider:

touchBarSlider.label

string 表示滑块当前的文本。更改此值会立即更新触控栏中的滑块。

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

touchBarSlider.value

number 表示滑块的当前值。更改此值会立即更新触控栏中的滑块。

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

touchBarSlider.minValue

number 表示滑块当前的最小值。更改此值会立即更新触控栏上的滑块。

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

touchBarSlider.maxValue

number 表示滑块当前的最大值。更改此值会立即更新触控栏上的滑块。

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