|
| 1 | +<template> |
| 2 | + <validation-provider :name="name" :rules="rules" tag="div"> |
| 3 | + <label :for="id" class="labelText">{{ label }}</label> |
| 4 | + <VInputField |
| 5 | + :id="id" |
| 6 | + type="number" |
| 7 | + :name="name" |
| 8 | + :placeholder="placeholder" |
| 9 | + :step="step" |
| 10 | + :value="value" |
| 11 | + :unit="unit" |
| 12 | + :required="required" |
| 13 | + :floating-point="floatingPoint" |
| 14 | + :pulse="pulse" |
| 15 | + :temperature="temperature" |
| 16 | + :spo2="spo2" |
| 17 | + @input="$emit('input', $event.target.value)" |
| 18 | + /> |
| 19 | + </validation-provider> |
| 20 | +</template> |
| 21 | + |
| 22 | +<script lang="ts"> |
| 23 | +import { Component, Prop, Vue } from 'vue-property-decorator' |
| 24 | +import VInputField from '@/components/VInputField.vue' |
| 25 | +@Component({ |
| 26 | + components: { |
| 27 | + VInputField, |
| 28 | + }, |
| 29 | +}) |
| 30 | +export default class InputNumberField extends Vue { |
| 31 | + @Prop({ type: String, default: '' }) |
| 32 | + id: string | undefined |
| 33 | +
|
| 34 | + @Prop({ type: String, default: '' }) |
| 35 | + rules: string | undefined |
| 36 | +
|
| 37 | + @Prop({ type: String, default: 0 }) |
| 38 | + value: string | undefined |
| 39 | +
|
| 40 | + @Prop({ type: String, default: '' }) |
| 41 | + label: string | undefined |
| 42 | +
|
| 43 | + @Prop({ type: String, default: '' }) |
| 44 | + name: string | undefined |
| 45 | +
|
| 46 | + @Prop({ type: String, default: '' }) |
| 47 | + placeholder: string | undefined |
| 48 | +
|
| 49 | + @Prop({ type: String, default: '' }) |
| 50 | + unit: string | undefined |
| 51 | +
|
| 52 | + @Prop({ type: Number, default: 0 }) |
| 53 | + step: number | undefined |
| 54 | +
|
| 55 | + @Prop({ type: Boolean, default: false }) |
| 56 | + required: boolean | undefined |
| 57 | +
|
| 58 | + @Prop({ type: Boolean, default: false }) |
| 59 | + floatingPoint: boolean | undefined |
| 60 | +
|
| 61 | + @Prop({ type: Boolean, default: false }) |
| 62 | + pulse: boolean | undefined |
| 63 | +
|
| 64 | + @Prop({ type: Boolean, default: false }) |
| 65 | + temperature: boolean | undefined |
| 66 | +
|
| 67 | + @Prop({ type: Boolean, default: false }) |
| 68 | + spo2: boolean | undefined |
| 69 | +} |
| 70 | +</script> |
| 71 | + |
| 72 | +<style lang="scss" scoped> |
| 73 | +.labelText { |
| 74 | + display: block; |
| 75 | + margin: 0 0 8px; |
| 76 | + font-size: 16px; |
| 77 | +} |
| 78 | +</style> |
0 commit comments