All files / lib/components navbar.vue

43.75% Statements 7/16
16.67% Branches 3/18
60% Functions 3/5
43.75% Lines 7/16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 5718x 18x 18x   18x 18x                     18x     18x                                                                          
<template>
    <nav :class="classObject">
    I    <slot></slot>
    </nav>
</template>E
 
 
<script>
    export default {
        computed: {
            classObject() {
                return [
                    'navbar',
                    this.type ? `navbar-${this.type}` : null,
                    this.variant ? `bg-${this.variant}` : null,
                    this.fixed ? `fixed-${this.fixed}` : null,
                    this.sticky ? 'sticky-top' : null,
                    this.toggleable ? this.toggleableClass : null
                ];
            },
            toggleableClass() {
                let className = 'navbar-toggleable';

                if (this.toggleBreakpoint) {
                    className += `-${this.toggleBreakpoint}`;
                }
 
                return className;
            }
        },
        props: {
            type: {
                type: String,
                default: 'light'
            },
            variant: {
                type: String
            },
            toggleable: {
                type: Boolean,
                default: false
            },
            toggleBreakpoint: {
                type: String,
                default: null
            },
            fixed: {
                type: String
            },
            sticky: {
                type: Boolean,
                default: false
            }
        }
    };
</script>