<template>
    <v-card :title="title">
        <v-card-subtitle>
            Medicated Feed : 
            <template v-if="mf.isNew">New</template>
            <template v-else>{{ mf.id }}</template>
        </v-card-subtitle>
        <v-card-text>
            <v-container>
                <v-row>
                    <v-col cols="6">
    {{ mf }}
                    </v-col>
                </v-row>
            </v-container>
        </v-card-text>
        <v-card-actions>
            <v-btn v-if="!mf.isNew" color="red-darken-1"
                   variant="text"
                   @click="saveMedFeed(mf)">Save</v-btn>
            <v-btn v-if="mf.isNew" color="red-darken-1"
                   variant="text"
                   @click="saveMedFeed(mf)">Add</v-btn>
            <v-spacer></v-spacer>
            <v-btn color="blue-darken-1"
                   variant="text"
                   @click="close">Close</v-btn>
        </v-card-actions>
    </v-card>
</template>
<script> 
export default {
    props:{
        set_mf: {}
    },
    watch: {
        set_mf(newval) {
            this.mf = newval
        },
    },
    data() {
        return {
            mf: this.set_mf,
        }
    },
    methods: {
        close() {
            this.$emit('closetab','list')
        },
        saveMedFeed(medfeed) {
            console.log(medfeed)
        }
    }
}
</script>
