<template>
    <on-the-fly
        :type="context.type"
        :id="context.id"
        :action="context.action"
        :buttonText="options.buttonText"
        :displayBadge="options.displayBadge === 'true'"
        :isDead="options.isDead"
        :parent="options.parent"
        @saveFormOnTheFly="saveFormOnTheFly">
    </on-the-fly>
</template>

<script>
import OnTheFly from './components/OnTheFly.vue';

export default {
    name: "App",
    components: {
        OnTheFly
    },
    props: ['onTheFly'],
    computed: {
        context() {
            return this.onTheFly.context;
        },
        options() {
            return this.onTheFly.options;
        }
    },
    mounted() {
        //console.log('OnTheFly mounted');
        //console.log('OnTheFly: data context', this.context);
        //console.log('OnTheFly: data options', this.options);
    },
    methods: {
        saveFormOnTheFly(payload) {
            console.log('saveFormOnTheFly', payload);
        }
    }
}
</script>

