Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 4aa4a40

Browse files
committed
fix: prop active and activeClass across the library have been standardized and now is more in line with Bootstrap-vue fixes bootstrap-vue-next#1378
fix(BDropdownItem): missing BLinkProps fixes bootstrap-vue-next#1383
1 parent 57261cd commit 4aa4a40

File tree

8 files changed

+35
-26
lines changed

8 files changed

+35
-26
lines changed

packages/bootstrap-vue-next/src/components/BAvatar/BAvatar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const props = withDefaults(
8181
variant: 'secondary',
8282
// Link props
8383
active: undefined,
84-
activeClass: 'router-link-active',
84+
activeClass: undefined,
8585
append: false,
8686
href: undefined,
8787
// noPrefetch: {type: [Boolean, String] as PropType<Booleanish>, default: false},

packages/bootstrap-vue-next/src/components/BBadge/BBadge.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const props = withDefaults(
3333
variant: 'secondary',
3434
// Link props
3535
active: undefined,
36-
activeClass: 'router-link-active',
36+
activeClass: undefined,
3737
append: false,
3838
disabled: false,
3939
href: undefined,

packages/bootstrap-vue-next/src/components/BBreadcrumb/BBreadcrumbItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const props = withDefaults(
3737
text: undefined,
3838
// Link props
3939
active: false,
40-
activeClass: 'router-link-active',
40+
activeClass: undefined,
4141
append: false,
4242
disabled: false,
4343
event: 'click',

packages/bootstrap-vue-next/src/components/BButton/BButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const props = withDefaults(
8585
block: false,
8686
loadingText: 'Loading...',
8787
// Link props
88-
activeClass: 'router-link-active',
88+
activeClass: undefined,
8989
append: false,
9090
disabled: false,
9191
event: 'click',

packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItem.vue

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<script setup lang="ts">
2323
import BLink from '../BLink/BLink.vue'
2424
import {computed, inject, useAttrs} from 'vue'
25-
import type {Booleanish, ClassValue, ColorVariant, LinkTarget} from '../../types'
25+
import type {BLinkProps, ClassValue} from '../../types'
2626
import {useBooleanish} from '../../composables'
2727
import {collapseInjectionKey, dropdownInjectionKey, navbarInjectionKey} from '../../utils'
2828
@@ -31,23 +31,32 @@ defineOptions({
3131
})
3232
3333
const props = withDefaults(
34-
defineProps<{
35-
href?: string
36-
linkClass?: ClassValue
37-
active?: Booleanish
38-
disabled?: Booleanish
39-
rel?: string
40-
target?: LinkTarget
41-
variant?: ColorVariant | null
42-
}>(),
34+
defineProps<
35+
{
36+
linkClass?: ClassValue
37+
} & Omit<BLinkProps, 'event' | 'routerTag'>
38+
>(),
4339
{
44-
active: false,
45-
disabled: false,
46-
rel: undefined,
47-
target: '_self',
48-
variant: null,
4940
linkClass: undefined,
41+
// Link props
42+
active: undefined,
43+
activeClass: undefined,
44+
append: false,
5045
href: undefined,
46+
// noPrefetch: {type: [Boolean, String] as PropType<Booleanish>, default: false},
47+
// prefetch: {type: [Boolean, String] as PropType<Booleanish>, default: null},
48+
rel: undefined,
49+
replace: false,
50+
routerComponentName: 'router-link',
51+
target: '_self',
52+
to: undefined,
53+
opacity: undefined,
54+
opacityHover: undefined,
55+
underlineVariant: null,
56+
underlineOffset: undefined,
57+
underlineOffsetHover: undefined,
58+
underlineOpacity: undefined,
59+
underlineOpacityHover: undefined,
5160
}
5261
)
5362
@@ -79,7 +88,7 @@ const tag = computed<'button' | 'a' | typeof BLink>(() =>
7988
)
8089
8190
const componentAttrs = computed(() => ({
82-
...(attrs.to ? {activeClass: 'active', ...attrs} : attrs),
91+
...(attrs.to ? {activeClass: props.activeClass, ...attrs} : attrs),
8392
}))
8493
8594
const collapseData = inject(collapseInjectionKey, null)

packages/bootstrap-vue-next/src/components/BLink/BLink.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ defineSlots<{
3737
3838
const props = withDefaults(defineProps<BLinkProps>(), {
3939
active: undefined,
40-
activeClass: 'router-link-active',
40+
activeClass: undefined,
4141
append: false,
4242
disabled: false,
4343
event: 'click',
@@ -151,7 +151,7 @@ const routerAttr = computed(() => ({
151151
}))
152152
153153
const computedLinkClasses = computed(() => ({
154-
[props.activeClass]: activeBoolean.value,
154+
[props.activeClass ?? 'active']: activeBoolean.value,
155155
disabled: disabledBoolean.value,
156156
}))
157157
@@ -176,7 +176,7 @@ const clicked = (e: MouseEvent): void => {
176176
*/
177177
export const BLINK_PROPS = {
178178
active: {type: [Boolean, String, undefined] as PropType<Booleanish>, default: undefined},
179-
activeClass: {type: String, default: 'router-link-active'},
179+
activeClass: {type: String, default: undefined},
180180
append: {type: [Boolean, String] as PropType<Booleanish>, default: false},
181181
disabled: {type: [Boolean, String] as PropType<Booleanish>, default: false},
182182
event: {type: [String, Array], default: 'click'},

packages/bootstrap-vue-next/src/components/BNav/BNavItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class="nav-link"
55
:class="linkClass"
66
v-bind="{...computedLinkProps, ...linkAttrs}"
7-
:active-class="activeClass ?? 'active'"
7+
:active-class="activeClass"
88
:tabindex="disabledBoolean ? -1 : undefined"
99
:aria-disabled="disabledBoolean ? true : undefined"
1010
@click="emit('click', $event)"
@@ -37,7 +37,7 @@ const props = withDefaults(
3737
linkClass: undefined,
3838
// Link props
3939
active: undefined,
40-
activeClass: 'router-link-active',
40+
activeClass: undefined,
4141
append: false,
4242
linkAttrs: undefined,
4343
disabled: false,

packages/bootstrap-vue-next/src/components/BNavbar/BNavbarBrand.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const props = withDefaults(
2525
tag: 'div',
2626
// Link props
2727
active: undefined,
28-
activeClass: 'router-link-active',
28+
activeClass: undefined,
2929
append: false,
3030
disabled: false,
3131
href: undefined,

0 commit comments

Comments
 (0)