File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 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'
22
33const CSidebarBrand = defineComponent ( {
44 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+ )
726 } ,
827} )
928
Original file line number Diff line number Diff line change @@ -5,3 +5,10 @@ import { CSidebarBrand } from '@coreui/vue'
55// or
66import CSidebarBrand from ' @coreui/vue/src/components/sidebar/CSidebarBrand'
77```
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