---
url: /docs/forms/components/slider.md
---
# 滑块组件

[ElementPlus 滑块组件](https://element-plus.org/zh-CN/component/slider.html)

以下是去掉方法说明后面参数类型的中文文档，方法标题不使用反引号：

# 滑块组件方法说明

### 设置最小值

```php
$this->min(0);
```

最小值。

***

### 设置最大值

```php
$this->max(100);
```

最大值，默认值: 100。

***

### 设置禁用状态

```php
$this->disabled(true);
```

是否禁用，默认值: false。

***

### 设置步长

```php
$this->step(1);
```

步长，默认值: 1。

***

### 设置是否显示输入框

```php
$this->showInput(true);
```

是否显示输入框，仅在非范围选择时有效，默认值: false。

***

### 设置输入框控制按钮

```php
$this->showInputControls(true);
```

在显示输入框的情况下，是否显示输入框的控制按钮，默认值: true。

***

### 设置输入框的尺寸

```php
$this->inputSize('small');
```

输入框的尺寸，可选值: large / medium / small / mini，默认值: small。

***

### 设置是否显示间断点

```php
$this->showStops(true);
```

是否显示间断点，默认值: false。

***

### 设置是否显示 tooltip

```php
$this->showTooltip(true);
```

是否显示 tooltip，默认值: true。

***

### 设置格式化 tooltip message

```php
$this->formatTooltip(function($value) {
    return "当前值: " . $value;
});
```

格式化 tooltip message。

***

### 设置是否为范围选择

```php
$this->range(true);
```

是否为范围选择，默认值: false。

***

### 设置是否竖向模式

```php
$this->vertical(true);
```

是否竖向模式，默认值: false。

***

### 设置 Slider 高度

```php
$this->height('300px');
```

Slider 高度，竖向模式时必填。

***

### 设置屏幕阅读器标签

```php
$this->label('滑块');
```

屏幕阅读器标签。

***

### 设置输入时的去抖延迟

```php
$this->debounce(300);
```

输入时的去抖延迟，毫秒，仅在 show-input 等于 true 时有效，默认值: 300。

***

### 设置 tooltip 的自定义类名

```php
$this->tooltipClass('custom-tooltip');
```

tooltip 的自定义类名。
