Skip to content

滑块 Slider

通过拖动滑块在一个固定区间内进行选择

示例代码

<script setup lang="ts">
import { ref } from "vue";
import { ESStepSlider } from "earthsdk-ui";
const timeLine = [
  "1",
  "2",
  "3",
  "4",
  "5",
  "6",
  "7",
  "8",
  "9",
  "10",
  "6",
  "7",
  "8",
  "9",
  "10",
];
const a = ref(4);
const ab = (val: string, index: number) => {
  console.log(val, index);
};
</script>

<template>
  <div class="ESStepSlider">
    <ESStepSlider
      :timeLine="timeLine"
      :value="a"
      @changeValue="ab"
    ></ESStepSlider>
  </div>
</template>

<style scoped>
.ESStepSlider {
  width: 500px;
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}
</style>

Attributes

属性名说明类型默认值
timeLine时间线string[]""
value时间线名称下标number""