Skip to content

Commit

Permalink
Merge pull request #352 from storyblok/bugfix/WORK-723-sb-group-button
Browse files Browse the repository at this point in the history
fix(work-723): sbGroupButton fix component update when changing props
  • Loading branch information
Pablo Veiga authored Jan 17, 2023
2 parents bc3d4c0 + 0e00192 commit 66cebf0
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/AvatarGroup/SbAvatarGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default {
},
},
emits: ['click'],
emits: ['click', 'toggle-visible-dropdown'],
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/components/AvatarGroup/components/SbMoreAvatars.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default {
},
},
emits: ['click'],
emits: ['click', 'toggle-avatars-dropdown'],
data() {
return {
Expand Down
5 changes: 4 additions & 1 deletion src/components/Breadcrumbs/BreadcrumbItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export default {
type: String,
default: null,
},
to: [String, Object],
to: {
type: [String, Object],
default: null,
},
replace: Boolean,
},
Expand Down
25 changes: 20 additions & 5 deletions src/components/Breadcrumbs/BreadcrumbLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,30 @@ export default {
type: String,
default: null,
},
title: String,
target: String,
title: {
type: String,
default: '',
},
target: {
type: String,
default: '',
},
append: Boolean,
disabled: Boolean,
exact: Boolean,
exactActiveClass: String,
exactActiveClass: {
type: String,
default: '',
},
link: Boolean,
href: String,
to: [String, Object],
href: {
type: String,
default: '',
},
to: {
type: [String, Object],
default: null,
},
replace: Boolean,
},
Expand Down
8 changes: 4 additions & 4 deletions src/components/GroupButton/SbGroupButton.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="sb-group-button" :class="activeClasses" v-bind="$attrs">
<VNodes :vnodes="activeSlots" />
<VNodes :vnodes="activeSlots()" />
</div>
</template>

Expand All @@ -25,9 +25,11 @@ export default {
'sb-group-button--has-spaces': this.hasSpaces,
}
},
},
methods: {
activeSlots() {
const children = this.$slots.default && this.$slots.default()
const chilrenWithProps = children
return children
.filter((b) => b.__v_isVNode)
.map((button) => {
button.props = {
Expand All @@ -36,8 +38,6 @@ export default {
}
return button
})
return chilrenWithProps
},
},
}
Expand Down
1 change: 1 addition & 0 deletions src/components/GroupButton/group-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

&:not(&--has-spaces) {
.sb-button {
margin: 0;
border-radius: 0;
}

Expand Down

0 comments on commit 66cebf0

Please sign in to comment.