Skip to content

Commit

Permalink
add maxlength property to fieldText
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Jul 7, 2016
1 parent 302ba3f commit 3fede6d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
54 changes: 27 additions & 27 deletions dev/app.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<template lang="jade">
.row
.col-md-10.col-md-offset-1
data-table(:rows="rows", :selected="selected", :select="selectRow")

.row(v-show="model")
.col-md-5.col-md-offset-1
.buttons.text-center
button.btn.btn-default.new(@click="newModel")
i.fa.fa-plus
| New
button.btn.btn-primary.save(@click="saveModel")
i.fa.fa-floppy-o
| Save
i.fa.fa-warning(v-if="showWarning()")
button.btn.btn-danger.delete(@click="deleteModel")
i.fa.fa-trash
| Delete

.errors.text-center
div.alert.alert-danger(v-for="item in validationErrors", track-by="$index") {{ item.field.label}}:
strong {{ item.error }}

vue-form-generator(:schema='schema', :model='model', :options='formOptions', :multiple="selected.length > 1", v-ref:form, :is-new-model="isNewModel")


.col-md-6
pre(v-if='model') {{{ model | prettyJSON }}}
.row
.col-md-10.col-md-offset-1
data-table(:rows="rows", :selected="selected", :select="selectRow")

.row(v-show="model")
.col-md-5.col-md-offset-1
.buttons.text-center
button.btn.btn-default.new(@click="newModel")
i.fa.fa-plus
| New
button.btn.btn-primary.save(@click="saveModel")
i.fa.fa-floppy-o
| Save
i.fa.fa-warning(v-if="showWarning()")
button.btn.btn-danger.delete(@click="deleteModel")
i.fa.fa-trash
| Delete

.errors.text-center
div.alert.alert-danger(v-for="item in validationErrors", track-by="$index") {{ item.field.label}}:
strong {{ item.error }}

vue-form-generator(:schema='schema', :model='model', :options='formOptions', :multiple="selected.length > 1", v-ref:form, :is-new-model="isNewModel")


.col-md-6
pre(v-if='model') {{{ model | prettyJSON }}}

</template>

Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldText.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input.form-control(type="text", v-model="value", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
input.form-control(type="text", v-model="value", :maxlength="schema.max", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
component: require("./formGenerator.vue"),
schema: require("./utils/schema.js"),
validators: require("./utils/validators.js"),

install(Vue) {
Vue.component("VueFormGenerator", module.exports.component);
}
Expand Down

0 comments on commit 3fede6d

Please sign in to comment.