Skip to content

Commit 0bc9c7f

Browse files
committed
feat(CInputGroupText): add dynamic component support
1 parent 2572bea commit 0bc9c7f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/components/form/CInputGroupText.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,20 @@ import { defineComponent, h } from 'vue'
22

33
const CInputGroupText = defineComponent({
44
name: 'CInputGroupText',
5-
setup(_, { slots }) {
6-
return () => h('span', { class: 'input-group-text' }, 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+
* @default 'span'
10+
*/
11+
component: {
12+
type: String,
13+
required: false,
14+
default: 'span',
15+
},
16+
},
17+
setup(props, { slots }) {
18+
return () => h(props.component, { class: 'input-group-text' }, slots.default && slots.default())
719
},
820
})
921

0 commit comments

Comments
 (0)