@coreui/vue-pro
Version:
UI Components Library for Vue.js
50 lines (47 loc) • 1.31 kB
JavaScript
import { defineComponent, h } from 'vue';
import { CNavLink } from './CNavLink.js';
const CNavItem = defineComponent({
name: 'CNavItem',
inheritAttrs: false,
props: {
/**
* Toggle the active state for the component.
*/
active: Boolean,
/**
* Component used for the root node. Either a string to use a HTML element or a component.
*/
as: {
type: String,
default: 'li',
},
/**
* A string of all className you want applied to the component.
*/
class: String,
/**
* Toggle the disabled state for the component.
*/
disabled: Boolean,
/**
* @ignore
*/
href: String,
},
setup(props, { attrs, slots }) {
return () => h(props.as, {
class: ['nav-item', props.class],
}, props.href
? h(CNavLink, {
...attrs,
active: props.active,
disabled: props.disabled,
href: props.href,
}, {
default: () => slots.default && slots.default(),
})
: slots.default && slots.default());
},
});
export { CNavItem };
//# sourceMappingURL=CNavItem.js.map