Skip to content

Commit 42ca902

Browse files
authored
fix(navbar): breakpoint not working
1 parent 825093f commit 42ca902

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/components/navbar.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ export const props = {
1313
type: String
1414
},
1515
toggleable: {
16-
type: Boolean,
16+
type: [Boolean, String],
1717
default: false
1818
},
1919
toggleBreakpoint: {
20+
// Deprecated: to be removed soon
2021
type: String,
2122
default: null
2223
},
@@ -33,11 +34,10 @@ export default {
3334
functional: true,
3435
props,
3536
render(h, { props, data, children }) {
36-
let toggleClass = "navbar-toggleable";
37-
if (props.toggleBreakpoint) {
38-
toggleClass += `-${props.toggleBreakpoint}`;
37+
let breakpoint = this.toggleBreakpoint || 'sm';
38+
if (typeof this.toggleable === 'string') {
39+
breakpoint = this.toggleable;
3940
}
40-
4141
return h(
4242
props.tag,
4343
mergeData(data, {
@@ -47,7 +47,7 @@ export default {
4747
[`bg-${props.variant}`]: Boolean(props.variant),
4848
[`fixed-${props.fixed}`]: Boolean(props.fixed),
4949
"sticky-top": props.sticky,
50-
[toggleClass]: props.toggleable
50+
[`navbar-expand-${breakpoint}`]: Boolean(props.toggleable)
5151
}
5252
}),
5353
children

0 commit comments

Comments
 (0)