@coreui/vue
Version:
UI Components Library for Vue.js
53 lines (49 loc) • 1.35 kB
JavaScript
;
var vue = require('vue');
const CSidebarNav = vue.defineComponent({
name: 'CSidebarNav',
props: {
/**
* Component used for the root node. Either a string to use a HTML element or a component.
*/
as: {
type: [Object, String],
default: 'ul',
},
/**
* Make navigation more compact by cutting link padding in half.
*
* @since 5.9.0
*/
compact: Boolean,
/**
* Sets the navigation variant.
*
* @since 5.9.0
*/
variant: {
type: String,
default: undefined,
},
},
setup(props, { slots }) {
const activeGroupKey = vue.ref();
vue.provide('cNavGroupActiveKey', activeGroupKey);
vue.provide('cNavGroupSetActiveKey', (value) => {
activeGroupKey.value = value;
});
return () => vue.h(props.as, {
class: [
'sidebar-nav',
{
compact: props.compact,
'sidebar-nav-tree': props.variant === 'tree',
},
],
}, {
default: () => slots.default && slots.default(),
});
},
});
exports.CSidebarNav = CSidebarNav;
//# sourceMappingURL=CSidebarNav.js.map