UNPKG

bootstrap-vue

Version:

With more than 85 components, over 45 available plugins, several directives, and 1000+ icons, BootstrapVue provides one of the most comprehensive implementations of the Bootstrap v4 component and grid system available for Vue.js v2.6, complete with extens

39 lines (33 loc) 991 B
import Vue, { mergeData } from '../../vue' import { NAME_NAVBAR_NAV } from '../../constants/components' import { pluckProps } from '../../utils/props' import { props as BNavProps } from '../nav/nav' // -- Constants -- export const props = pluckProps(['tag', 'fill', 'justified', 'align', 'small'], BNavProps) // -- Utils -- const computeJustifyContent = value => { // Normalize value value = value === 'left' ? 'start' : value === 'right' ? 'end' : value return `justify-content-${value}` } // @vue/component export const BNavbarNav = /*#__PURE__*/ Vue.extend({ name: NAME_NAVBAR_NAV, functional: true, props, render(h, { props, data, children }) { return h( props.tag, mergeData(data, { staticClass: 'navbar-nav', class: { 'nav-fill': props.fill, 'nav-justified': props.justified, [computeJustifyContent(props.align)]: props.align, small: props.small } }), children ) } })