Skip to main content

类:TouchBarSlider

类:TouchBarSlider

🌐 Class: TouchBarSlider

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

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

new TouchBarSlider(options)

  • options 对象
    • label 字符串(可选)- 标签文本。
    • value 整数(可选)- 选定的值。
    • minValue 整数(可选)- 最小值。
    • maxValue 整数(可选)- 最大值。
    • change 函数(可选)- 当滑块改变时调用的函数。
      • newValue 数字 - 用户在滑块上选择的值。

实例属性

🌐 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.