滑块
基本使用
当前值: 30
查看示例
vue
<script setup lang="ts">
import { ref } from 'vue'
const value = ref(30)
</script>
<template>
<yy-slider v-model="value" />
<p>当前值: {{ value }}</p>
</template>设置范围
当前值: 50
查看示例
vue
<script setup lang="ts">
import { ref } from 'vue'
const value1 = ref(50)
</script>
<template>
<yy-slider v-model="value1" :min="10" :max="200" />
<p>当前值: {{ value1 }}</p>
</template>Props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| modelValue | 当前值 | number | 0 |
| min | 最小值 | number | 0 |
| max | 最大值 | number | 100 |
Events
| 事件名 | 说明 | 参数 |
|---|---|---|
| change | 值改变时触发 | (value: number) |
| input | 拖拽时触发 | (value: number) |