Profectus/src/components/fields/Slider.vue

28 lines
518 B
Vue
Raw Normal View History

2021-06-11 23:38:16 -05:00
<template>
<div class="field">
<span class="field-title" v-if="title">{{ title }}</span>
<tooltip :display="`${value}`" :class="{ fullWidth: !title }">
<input type="range" :value="value" @input="e => $emit('change', parseInt(e.target.value))" :min="min" :max="max" />
</tooltip>
2021-06-11 23:38:16 -05:00
</div>
</template>
<script>
export default {
name: 'Slider',
2021-06-11 23:38:16 -05:00
props: {
title: String,
value: Number,
min: Number,
max: Number
2021-07-24 17:08:52 -05:00
},
emits: [ 'change' ]
2021-06-11 23:38:16 -05:00
};
</script>
<style scoped>
2021-06-22 07:56:11 -05:00
.fullWidth {
width: 100%;
}
2021-06-11 23:38:16 -05:00
</style>