Skip to content

Commit

Permalink
[BtnGroup] Fix not merging data.
Browse files Browse the repository at this point in the history
  • Loading branch information
wxsms committed Nov 9, 2017
1 parent 5f0ea0a commit 029caa5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docs/pages/components/BtnGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ Make a group of buttons stretch at equal sizes to span the entire width of its p

```html
<btn-group justified>
<btn justified>Left</btn>
<btn justified>Middle</btn>
<btn justified>Right</btn>
<btn href="javascript:;">Left</btn>
<btn href="javascript:;">Middle</btn>
<btn href="javascript:;">Right</btn>
</btn-group>
<br/>
<btn-group justified>
Expand Down
8 changes: 5 additions & 3 deletions src/components/button/BtnGroup.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import mergeData from 'vue-functional-data-merge'

export default {
functional: true,
render (h, {props, children}) {
render (h, {props, children, data}) {
return h(
'div',
{
mergeData(data, {
class: {
'btn-group': !props.vertical,
'btn-group-vertical': props.vertical,
Expand All @@ -14,7 +16,7 @@ export default {
role: 'group',
'data-toggle': 'buttons'
}
},
}),
children
)
},
Expand Down
8 changes: 5 additions & 3 deletions src/components/button/BtnToolbar.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import mergeData from 'vue-functional-data-merge'

export default {
functional: true,
render (h, {children}) {
render (h, {children, data}) {
return h(
'div',
{
mergeData(data, {
class: {
'btn-toolbar': true
},
attrs: {
role: 'toolbar'
}
},
}),
children
)
}
Expand Down

0 comments on commit 029caa5

Please # to comment.