@gitlab/ui
Version:
GitLab UI Components
126 lines (114 loc) • 3.38 kB
JavaScript
import GlLink from '../link/link';
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
var script = {
name: 'GlNavItem',
components: {
GlLink
},
props: {
/**
* When set to `true`, places the component in the active state with active styling
*/
active: {
type: Boolean,
required: false,
default: false
},
/**
* When set to `true`, disables the component's functionality and places it in a disabled state.
*/
disabled: {
type: Boolean,
required: false,
default: false
},
/**
* Denotes the target URL of the link for standard links.
*/
href: {
type: String,
required: false,
default: undefined
},
/**
* <router-link> prop: Denotes the target route of the link.
* When clicked, the value of the to prop will be passed to `router.push()` internally,
* so the value can be either a string or a Location descriptor object.
*/
to: {
type: [Object, String],
required: false,
default: undefined
},
/**
* <router-link> prop: Configure the active CSS class applied when the link is active.
*/
activeClass: {
type: String,
required: false,
default: undefined
},
/**
* <router-link> prop: Configure the active CSS class applied when the link is active with exact match.
*/
exactActiveClass: {
type: String,
required: false,
default: undefined
},
/**
* Attributes for the link element
*/
linkAttrs: {
type: Object,
required: false,
default: null
},
/**
* Classes for the link element
*/
linkClasses: {
type: Array,
required: false,
default: () => []
}
},
computed: {
computedLinkClasses() {
const classes = this.linkClasses;
// the `unstyled` link variant does not do this by itself
if (this.disabled) classes.push('disabled');
if (this.active) classes.push('active');
return classes;
}
}
};
/* script */
const __vue_script__ = script;
/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('li',{staticClass:"nav-item"},[_c('gl-link',_vm._g(_vm._b({staticClass:"nav-link",class:_vm.computedLinkClasses,attrs:{"variant":"unstyled","active":_vm.active,"disabled":_vm.disabled,"href":_vm.href,"to":_vm.to,"active-class":_vm.activeClass,"exact-active-class":_vm.exactActiveClass}},'gl-link',_vm.linkAttrs,false),_vm.$listeners),[_vm._t("default")],2)],1)};
var __vue_staticRenderFns__ = [];
/* style */
const __vue_inject_styles__ = undefined;
/* scoped */
const __vue_scope_id__ = undefined;
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
const __vue_is_functional_template__ = false;
/* style inject */
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
__vue_inject_styles__,
__vue_script__,
__vue_scope_id__,
__vue_is_functional_template__,
__vue_module_identifier__,
false,
undefined,
undefined,
undefined
);
export { __vue_component__ as default };