57 lines
1,020 B
Vue
57 lines
1,020 B
Vue
<template>
|
|
<label
|
|
v-if="label"
|
|
class="block text-sm font-medium text-gray-700"
|
|
:for="id"
|
|
v-text="label"
|
|
/>
|
|
<input
|
|
:id="id"
|
|
class="mt-2 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
|
|
type="range"
|
|
:min="min"
|
|
:max="max"
|
|
:step="step"
|
|
:class="class"
|
|
:value="modelValue"
|
|
@input="$emit('update:modelValue', $event.target.value)"
|
|
>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
modelValue: {
|
|
},
|
|
label: {
|
|
type: String,
|
|
required: false,
|
|
},
|
|
id: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
min: {
|
|
type: Number,
|
|
required: false,
|
|
default: 0,
|
|
},
|
|
max: {
|
|
type: Number,
|
|
required: false,
|
|
default: 100,
|
|
},
|
|
step: {
|
|
type: Number,
|
|
required: false,
|
|
default: 0.1,
|
|
},
|
|
"class": {
|
|
type: String,
|
|
required: false,
|
|
},
|
|
},
|
|
emits: ['update:modelValue'],
|
|
}
|
|
</script>
|