feat: migrate Slider with native range semantics and strict ESM declarations

This commit is contained in:
maoyingjie
2026-10-23 13:12:26 +08:00
parent b1cb00deba
commit 4da45b109e
40 changed files with 2239 additions and 3 deletions
+27
View File
@@ -0,0 +1,27 @@
<script setup lang="ts">
import {
Label,
Slider,
SliderOutput,
SliderTrack,
SliderFill,
SliderThumb,
} from "@heroui-vue/components";
</script>
<template>
<Slider class="w-full max-w-xs" :default-value="[25, 75]">
<Label>区间</Label>
<SliderOutput v-slot="{ values, getThumbValueLabel }">
{{ values.map((_, i) => getThumbValueLabel(i)).join(" – ") }}
</SliderOutput>
<SliderTrack v-slot="{ values }">
<SliderFill />
<SliderThumb
v-for="(_, index) in values"
:key="index"
:index="index"
:aria-label="index === 0 ? '区间下限' : '区间上限'"
/>
</SliderTrack>
</Slider>
</template>