File tree 1 file changed +9
-2
lines changed
packages/coreui-vue/src/components/nav
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,12 @@ import type { ComponentProps } from '../../utils/ComponentProps'
5
5
6
6
interface CNavItemProps extends ComponentProps < typeof CNavLink > {
7
7
as : string
8
+ class : string
8
9
}
9
10
10
11
const CNavItem = defineComponent ( {
11
12
name : 'CNavItem' ,
13
+ inheritAttrs : false ,
12
14
props : {
13
15
/**
14
16
* Toggle the active state for the component.
@@ -21,6 +23,10 @@ const CNavItem = defineComponent({
21
23
type : String ,
22
24
default : 'li' ,
23
25
} ,
26
+ /**
27
+ * A string of all className you want applied to the component.
28
+ */
29
+ class : String ,
24
30
/**
25
31
* Toggle the disabled state for the component.
26
32
*/
@@ -30,17 +36,18 @@ const CNavItem = defineComponent({
30
36
*/
31
37
href : String ,
32
38
} ,
33
- setup ( props : CNavItemProps , { slots } ) {
39
+ setup ( props : CNavItemProps , { attrs , slots } ) {
34
40
return ( ) =>
35
41
h (
36
42
props . as ,
37
43
{
38
- class : 'nav-item' ,
44
+ class : [ 'nav-item' , props . class ] ,
39
45
} ,
40
46
props . href
41
47
? h (
42
48
CNavLink ,
43
49
{
50
+ ...attrs ,
44
51
active : props . active ,
45
52
disabled : props . disabled ,
46
53
href : props . href ,
You can’t perform that action at this time.
0 commit comments