1

I have sample code:

<template>
    <div>
        <v-text-field
                v-model="device.name"
        />
        <v-text-field
            v-model="device.serial_number"
        />
        <v-btn
            @click="save"
        />
    </div>
</template>

<script>
    export default {
        name: "DeviceDialog",
        methods: {
            save(){
                //axios magic
            },
        },
        props: {
            device: {
                type: Object,
                required: true
            },
        }
    }
</script>

The form is available when clicking on the list of devices, and i pass the item with all info as a prop but I heard that I shouldn't do it like that. What's the proper way?

0 Answers0