@coreui/vue-pro
Version:
UI Components Library for Vue.js
33 lines (30 loc) • 866 B
JavaScript
import { defineComponent, h } from 'vue';
import { CNavLink } from './CNavLink.js';
const CNavItem = defineComponent({
name: 'CNavItem',
props: {
...CNavLink.props,
/**
* Component used for the root node. Either a string to use a HTML element or a component.
*/
as: {
type: String,
default: 'li',
},
},
setup(props, { slots }) {
return () => h(props.as, {
class: 'nav-item',
}, props.href
? h(CNavLink, {
active: props.active,
disabled: props.disabled,
href: props.href,
}, {
default: () => slots.default && slots.default(),
})
: slots.default && slots.default());
},
});
export { CNavItem };
//# sourceMappingURL=CNavItem.js.map