feat: Initial revision
This commit is contained in:
34
src/components/TemperatureSlider.vue
Normal file
34
src/components/TemperatureSlider.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="temperature-slider">
|
||||
<input
|
||||
type="range"
|
||||
min="15"
|
||||
max="80"
|
||||
v-model="value"
|
||||
@change="valueChanged"
|
||||
/>
|
||||
<span>{{ value }} °C</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
initialValue: Number,
|
||||
},
|
||||
emits: ["value-changed"],
|
||||
data() {
|
||||
return {
|
||||
value: this.initialValue,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
valueChanged() {
|
||||
this.$emit("value-changed", this.value);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
Reference in New Issue
Block a user