Avance

ADempiereMarch 21, 2023
About 1 min

Drag the slider within a fixed range.

Basic usage

The current value is displayed when the slider is being dragged.

Customize the initial value of the slider by setting the binding value.

Default value
Hide Tooltip
Disabled

Viwer Source

<template>
  <el-card class="box-card">
    <FieldSlider
      v-model="0"
    />
    <FieldSlider
      v-model="0"
      :show-tooltip="false"
    />
    <FieldSlider
      v-model="0"
      :disabled="true"
    />
  </el-card>
</template>

Step

Set step size with the step attribute. You can display breakpoints by setting the show-stops attribute

Breakpoints not displayed
Breakpoints displayed

Viwer Source

<template>
  <el-card class="box-card">
    <FieldSlider
      v-model="0"
      :step="10"
    />
    <FieldSlider
      v-model="0"
      :step="10"
      :show-stops="true"
    />
  </el-card>
</template>

Range

Selecting a range of values is supported.

Setting the range attribute activates range mode, where the binding value is an array made up of two boundary values.

Viwer Source

<template>
  <el-card class="box-card">
    <FieldSlider
      v-model="0"
      :show-stops="true"
      :range="true"
      :max="10"
    />
  </el-card>
</template>

Vertical Mode

Setting the vertical attribute to true enables vertical mode. In vertical mode, the height attribute is required.

Viwer Source

<template>
  <el-card class="box-card">
    <FieldSlider
      v-model="0"
      :vertical="true"
    />
  </el-card>
</template>

Props

NameDescriptionTypeMandatory
percentagepercentage.NumberTrue
textInsidewhether to place the percentage inside progress bar, only works when type is 'line'.BooleanTrue

Attributes

NameDescriptionTypeDefault
typethe type of progress bar line/circle/dashboardStringline
strokeWidththe width of progress barNumber6
statusthe current status of progress bar success/exception/warningString────
indeterminateset indeterminate progressBooleanFalse
disabledDisable the ButtonBooleanFalse

Example for Developer

Open in StackBlitzopen in new window

Directory

  └─ src                                            # Main source code.
      └── Components                                # Global components
              └── Atoms                             # Atom components
                  └── FieldSilder                 # Field silder specific components.