Skip to content
Snippets Groups Projects
documentationPartMixin.js 911 B
Newer Older
/**
 * Mixin to provide common fields for all components specific to a singular documentation inside the coursebook
 */
export default {
    props: {
        /**
         * The documentation in question
         */
        documentation: {
            type: Object,
            required: true,
        },
        /**
         * Whether the documentation is currently in the compact mode (meaning coursebook row)
         */
        compact: {
            type: Boolean,
            required: false,
            default: false,
        }
    },

    computed: {
        /**
         * All necessary props bundled together to easily pass to child components
         * @returns {{compact: Boolean, documentation: Object}}
         */
        documentationPartProps() {
            return {
                documentation: this.documentation,
                compact: this.compact,
            }
        }
    }
};