<script lang="ts">
    export default {
        props: {
            data: {
                type: Object,
                required: true
            },
            filter: {
                type: Number,
                required: true
            },
            prop: {
                type: String,
                required: true
            }
        },
        data() {
            console.log(this.filter);
            return {
                data: this.data,
                filter: this.filter,
                prop: this.prop
            }
        },
        methods: {
            filterValue(event: any, prop: string){
                this.data[this.prop] = event.target.value;
                this.$emit('filterValue', event, prop);
            }
        }
    }
</script>

<template>
    <v-number-input 
        @blur="filterValue($event, prop)" 
        :v-model="data" 
        :model-value="filter" 
        :precision="2" 
        control-variant="hidden">
    </v-number-input>
</template>