Files
PhotonVision/chameleon-client/src/components/cv-number-input.vue

37 lines
843 B
Vue
Raw Normal View History

2019-09-28 21:42:04 +03:00
<template>
<div>
<v-row dense align="center">
2019-09-28 21:42:04 +03:00
<v-col :cols="2">
<span>{{name}}</span>
</v-col>
<v-col>
2019-10-29 23:58:06 +02:00
<v-text-field dark v-model="localValue" class="mt-0 pt-0" hide-details single-line type="number"
style="width: 70px"/>
2019-09-28 21:42:04 +03:00
</v-col>
</v-row>
</div>
</template>
<script>
export default {
name: 'NumberInput',
2019-10-29 23:58:06 +02:00
props: ['name', 'value'],
2019-09-28 21:42:04 +03:00
data() {
2019-10-29 23:58:06 +02:00
return {}
2019-09-28 21:42:04 +03:00
},
2019-10-29 23:58:06 +02:00
computed: {
localValue: {
get() {
2019-09-28 21:42:04 +03:00
return this.value;
},
2019-10-29 23:58:06 +02:00
set(value) {
this.$emit('input', parseInt(value));
2019-09-28 21:42:04 +03:00
}
}
}
}
</script>
<style lang="" scoped>
2019-10-29 23:58:06 +02:00
2019-09-28 21:42:04 +03:00
</style>