Skip to content

Commit

Permalink
Enhancement for issue #307 (#308)
Browse files Browse the repository at this point in the history
* Add bootstrap -> bootstrap-vue migration notes

* add bFormFieldset label text alignment options
  • Loading branch information
alexsasharegan authored and pi0 committed Apr 30, 2017
1 parent fa30802 commit 4c1424e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/components/form-fieldset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div :class="['form-group','row',inputState]">
<label :for="target"
v-if="label"
:class="['col-form-label',labelLayout]"
:class="['col-form-label',labelLayout,labelAlignClass]"
v-html="label"
></label>
<div :class="inputLayout" ref="content">
Expand Down Expand Up @@ -35,6 +35,17 @@
labelLayout() {
return this.horizontal ? ('col-sm-' + this.labelSize) : 'col-12';
},
labelAlignClass() {
switch (this.labelTextAlign.toLowerCase()) {
case 'center':
return 'text-center';
case 'right':
return 'text-right';
case 'left':
default:
return null;
}
},
inputLayout() {
return this.horizontal ? ('col-sm-' + (12 - this.labelSize)) : 'col-12';
}
Expand Down Expand Up @@ -68,6 +79,11 @@
type: Number,
default: 3
},
labelTextAlign: {
type: String,
required: false,
default: null
},
label: {
type: String,
default: null
Expand Down

0 comments on commit 4c1424e

Please sign in to comment.