File tree 2 files changed +28
-2
lines changed 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,27 @@ import { defineComponent, h } from 'vue'
2
2
3
3
const CSidebarBrand = defineComponent ( {
4
4
name : 'CSidebarBrand' ,
5
- setup ( _ , { slots } ) {
6
- return ( ) => h ( 'div' , { class : 'sidebar-brand' } , slots . default && slots . default ( ) )
5
+ props : {
6
+ /**
7
+ * Component used for the root node. Either a string to use a HTML element or a component.
8
+ *
9
+ */
10
+ as : {
11
+ type : String ,
12
+ default : 'div' ,
13
+ } ,
14
+ /**
15
+ * The href attribute specifies the URL of the page the link goes to.
16
+ */
17
+ href : String ,
18
+ } ,
19
+ setup ( props , { slots } ) {
20
+ return ( ) =>
21
+ h (
22
+ props . as ?? ( props . href ? 'a' : 'div' ) ,
23
+ { class : 'sidebar-brand' , href : props . href } ,
24
+ slots . default && slots . default ( ) ,
25
+ )
7
26
} ,
8
27
} )
9
28
Original file line number Diff line number Diff line change @@ -5,3 +5,10 @@ import { CSidebarBrand } from '@coreui/vue'
5
5
// or
6
6
import CSidebarBrand from ' @coreui/vue/src/components/sidebar/CSidebarBrand'
7
7
```
8
+
9
+ #### Props
10
+
11
+ | Prop name | Description | Type | Values | Default |
12
+ | --------- | --------------------------------------------------------------------------------------- | ------ | ------ | ------- |
13
+ | ** as** | Component used for the root node. Either a string to use a HTML element or a component. | string | - | 'div' |
14
+ | ** href** | The href attribute specifies the URL of the page the link goes to. | string | - | - |
You can’t perform that action at this time.
0 commit comments