Skip to content

Commit

Permalink
Add 'addons' prop to field (buefy#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaberaldo committed Jul 19, 2017
1 parent b6f5ad1 commit 617641e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* **New component: Menu**, [see docs](https://buefy.github.io/#/documentation/menu) (thanks @tsctao)
* Add CDN install method and JSFiddle examples
* Add boolean ``addons`` prop to field
* Fix message and notification inside ``.media`` element
* #171 Fix modal not taking full width on mobile
* #182 Fix table not default sorting async data (thanks @jtommy)
Expand Down
7 changes: 7 additions & 0 deletions docs/pages/documentation/form/Field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,13 @@
type: 'Boolean',
values: '<code>is-left</code>, <code>is-centered</code>, <code>is-right</code>',
default: '<code>is-left</code>'
},
{
name: '<code>addons</code>',
description: 'Field automatically unify controls',
type: 'Boolean',
values: '',
default: '<code>true</code>'
}
],
template1: `
Expand Down
8 changes: 6 additions & 2 deletions src/components/field/Field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
message: String,
grouped: Boolean,
position: String,
expanded: Boolean
expanded: Boolean,
addons: {
type: Boolean,
default: true
}
},
data() {
return {
Expand Down Expand Up @@ -64,7 +68,7 @@
fieldType() {
if (this.grouped) {
return 'is-grouped'
} else if (this.$slots.default !== undefined && this.$slots.default.length > 1) {
} else if (this.$slots.default !== undefined && this.$slots.default.length > 1 && this.addons) {
return 'has-addons'
}
}
Expand Down

0 comments on commit 617641e

Please sign in to comment.