Skip to content

added labelClasses support #342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 11, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/formGenerator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ div.vue-form-generator(v-if='schema != null')
fieldset(v-if="schema.fields", :is='tag')
template(v-for='field in fields')
.form-group(v-if='fieldVisible(field)', :class='getFieldRowClasses(field)')
label(v-if="fieldTypeHasLabel(field)", :for="getFieldID(field)")
label(v-if="fieldTypeHasLabel(field)", :for="getFieldID(field)", :class="field.labelClasses")
| {{ field.label }}
span.help(v-if='field.help')
i.icon
Expand All @@ -17,11 +17,11 @@ div.vue-form-generator(v-if='schema != null')
span(v-for='(error, index) in fieldErrors(field)', track-by='index') {{ error }}

template(v-for='group in groups')
fieldset(:is='tag', :class='getFieldRowClasses(group)')
fieldset(:is='tag')
legend(v-if='group.legend') {{ group.legend }}
template(v-for='field in group.fields')
.form-group(v-if='fieldVisible(field)', :class='getFieldRowClasses(field)')
label(v-if="fieldTypeHasLabel(field)", :for="getFieldID(field)")
label(v-if="fieldTypeHasLabel(field)", :for="getFieldID(field)", :class="field.labelClasses")
| {{ field.label }}
span.help(v-if='field.help')
i.icon
Expand Down Expand Up @@ -191,9 +191,7 @@ div.vue-form-generator(v-if='schema != null')
baseClasses[field.styleClasses] = true;
}

if (!isNil(field.type)) {
baseClasses["field-" + field.type] = true;
}
baseClasses["field-" + field.type] = true;

return baseClasses;
},
Expand Down Expand Up @@ -571,3 +569,11 @@ div.vue-form-generator(v-if='schema != null')

} // fieldset
</style>
// .errors
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops ... how'd that get there?


} // .error

} // .form-group

} // fieldset
</style>