Skip to content

Commit e9256c1

Browse files
committed
feat: add booleanish to bbuttongroup
1 parent f7674eb commit e9256c1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/bootstrap-vue-3/src/components/BButton/BButtonGroup.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66

77
<script setup lang="ts">
88
// import type {BButtonGroupProps} from '../../types/components'
9+
import type {Booleanish} from '../../types'
910
import {computed} from 'vue'
11+
import {resolveBooleanish} from '../../utils'
1012
1113
interface BButtonGroupProps {
1214
ariaRole?: string
1315
size?: string
1416
tag?: string
15-
vertical?: boolean
17+
vertical?: Booleanish
1618
}
1719
1820
const props = withDefaults(defineProps<BButtonGroupProps>(), {
@@ -21,9 +23,11 @@ const props = withDefaults(defineProps<BButtonGroupProps>(), {
2123
vertical: false,
2224
})
2325
26+
const verticalBoolean = computed<boolean>(() => resolveBooleanish(props.vertical))
27+
2428
const classes = computed(() => ({
25-
'btn-group': !props.vertical,
26-
'btn-group-vertical': props.vertical,
29+
'btn-group': !verticalBoolean.value,
30+
'btn-group-vertical': verticalBoolean.value,
2731
[`btn-group-${props.size}`]: props.size,
2832
}))
2933
</script>

0 commit comments

Comments
 (0)