Skip to content

Commit 1f64a11

Browse files
author
Issayah
committed
refactor: move isAction logic to separate computed
1 parent c91801d commit 1f64a11

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

packages/bootstrap-vue-3/src/components/BListGroup/BListGroupItem.vue

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,20 @@ const tagComputed = computed<string | typeof BLink>(() =>
6868
parentData?.numbered ? 'li' : buttonBoolean.value ? 'button' : !link.value ? props.tag : BLink
6969
)
7070
71-
const computedClasses = computed(() => {
72-
const isAction =
71+
const isAction = computed(
72+
() =>
7373
actionBoolean.value ||
7474
link.value ||
7575
buttonBoolean.value ||
7676
['a', 'router-link', 'button', 'b-link'].includes(props.tag)
77-
return {
78-
[`list-group-item-${props.variant}`]: props.variant !== undefined,
79-
'list-group-item-action': isAction,
80-
'active': activeBoolean.value,
81-
'disabled': disabledBoolean.value,
82-
}
83-
})
77+
)
78+
79+
const computedClasses = computed(() => ({
80+
[`list-group-item-${props.variant}`]: props.variant !== undefined,
81+
'list-group-item-action': isAction.value,
82+
'active': activeBoolean.value,
83+
'disabled': disabledBoolean.value,
84+
}))
8485
8586
const computedAttrs = computed(() => {
8687
const localAttrs = {} as {type?: string; disabled?: boolean}

0 commit comments

Comments
 (0)