mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-22 01:11:40 +00:00
58 lines
1.2 KiB
Vue
58 lines
1.2 KiB
Vue
<template>
|
|
<div>
|
|
<v-row
|
|
dense
|
|
align="center"
|
|
>
|
|
<v-col :cols="labelCols || 2">
|
|
<tooltipped-label
|
|
:tooltip="tooltip"
|
|
:text="name"
|
|
/>
|
|
</v-col>
|
|
<v-col>
|
|
<v-text-field
|
|
v-model="localValue"
|
|
dark
|
|
class="mt-0 pt-0"
|
|
hide-details
|
|
single-line
|
|
color="accent"
|
|
type="number"
|
|
style="width: 70px"
|
|
:step="step"
|
|
:disabled="disabled"
|
|
:rules="rules"
|
|
/>
|
|
</v-col>
|
|
</v-row>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import TooltippedLabel from "./cv-tooltipped-label";
|
|
|
|
export default {
|
|
name: 'NumberInput',
|
|
components: {
|
|
TooltippedLabel,
|
|
},
|
|
// eslint-disable-next-line vue/require-prop-types
|
|
props: ['name', 'value', 'step', 'labelCols', 'rules', 'tooltip', 'disabled'],
|
|
computed: {
|
|
localValue: {
|
|
get() {
|
|
return this.value;
|
|
},
|
|
set(value) {
|
|
this.$emit('input', parseFloat(value));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="" scoped>
|
|
|
|
</style>
|