Skip to content

Commit dcb3789

Browse files
committed
minor fixes to labels etc
1 parent 8b02794 commit dcb3789

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ These should be added to the `templateOptions` property. Some input types may ha
110110

111111
| Property | Type | Default | Description |
112112
| --- | --- | --- | --- |
113+
| label | `string` | `null` | A string containing the field label |
113114
| onBlur | `function(e)` | `null` | A function to run on @blur event |
114115
| onFocus | `function(e)` | `null` | A function to run on @focus event |
115116
| onClick | `function(e)` | `null` | A function to run on @click event |
@@ -124,7 +125,7 @@ These should be added to the `templateOptions` property. Some input types may ha
124125

125126
| Property | Type | Default | Description |
126127
| --- | --- | --- | --- |
127-
| type | `string` | `text` | The 'type' attribute to pass to the input. Can be any valid input type. |
128+
| inputType | `string` | `text` | The 'type' attribute to pass to the input. Can be any valid input type. |
128129

129130
####List options
130131

dist/vue-formly-bootstrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-formly-bootstrap v2.0.0
2+
* vue-formly-bootstrap v2.0.1
33
* https://github.com/matt-sanders/vue-formly-bootstrap
44
* Released under the MIT License.
55
*/
@@ -761,7 +761,7 @@ return /******/ (function(modules) { // webpackBootstrap
761761
/* 41 */
762762
/***/ function(module, exports) {
763763

764-
module.exports = "\n<div class=\"form-group formly-input\" :class=\"[ to.type, {'formly-has-value': model[field.key], 'formly-has-focus': form[field.key].$active}]\">\n <label v-if=\"to.label\" :for=\"to.id ? to.id : null\">{{to.label}}</label>\n <input class=\"form-control\" :class=\"to.classes\" :id=\"to.id ? to.id : null\" type=\"text\" v-model=\"model[field.key]\" @blur=\"onBlur\" @focus=\"onFocus\" @click=\"onClick\" @change=\"onChange\" @keyup=\"onKeyup\" @keydown=\"onKeydown\" v-formly-atts=\"to.atts\" v-formly-input-type=\"to.type\">\n</div>\n";
764+
module.exports = "\n<div class=\"form-group formly-input\" :class=\"[ to.type, {'formly-has-value': model[field.key], 'formly-has-focus': form[field.key].$active}]\">\n <label v-if=\"to.label\" :for=\"to.id ? to.id : null\">{{to.label}}</label>\n <input class=\"form-control\" :class=\"to.classes\" :id=\"to.id ? to.id : null\" type=\"text\" v-model=\"model[field.key]\" @blur=\"onBlur\" @focus=\"onFocus\" @click=\"onClick\" @change=\"onChange\" @keyup=\"onKeyup\" @keydown=\"onKeydown\" v-formly-atts=\"to.atts\" v-formly-input-type=\"to.inputType\">\n</div>\n";
765765

766766
/***/ },
767767
/* 42 */

dist/vue-formly-bootstrap.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-formly-bootstrap",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "A bootstrap based form input bundle for Vue Formly",
55
"main": "dist/vue-formly-bootstrap.js",
66
"scripts": {

src/fields/fieldInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="form-group formly-input" :class="[ to.type, {'formly-has-value': model[field.key], 'formly-has-focus': form[field.key].$active}]">
33
<label v-if="to.label" :for="to.id ? to.id : null">{{to.label}}</label>
4-
<input class="form-control" :class="to.classes" :id="to.id ? to.id : null" type="text" v-model="model[field.key]" @blur="onBlur" @focus="onFocus" @click="onClick" @change="onChange" @keyup="onKeyup" @keydown="onKeydown" v-formly-atts="to.atts" v-formly-input-type="to.type">
4+
<input class="form-control" :class="to.classes" :id="to.id ? to.id : null" type="text" v-model="model[field.key]" @blur="onBlur" @focus="onFocus" @click="onClick" @change="onChange" @keyup="onKeyup" @keydown="onKeydown" v-formly-atts="to.atts" v-formly-input-type="to.inputType">
55
</div>
66
</template>
77

test/unit/specs/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ describe('Bootstrap Field Inputs', () => {
253253

254254
it('supports other input types', () => {
255255
data.fields[0].type = 'input';
256-
data.fields[0].templateOptions.type = 'password';
256+
data.fields[0].templateOptions.inputType = 'password';
257257
createForm(data);
258258

259259
let inputs = vm.$el.querySelectorAll('input');

0 commit comments

Comments
 (0)