Skip to content

Commit

Permalink
version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
fergaldoyle committed Jan 10, 2018
1 parent ca04364 commit 464126a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
22 changes: 19 additions & 3 deletions dist/vue-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,17 @@ var vueForm = {
return h(this.tag || this.vueFormConfig.formTag, {
on: {
submit: function submit(event) {
_this.state._submit();
_this.$emit('submit', event);
if (_this.state.$pending) {
event.preventDefault();
_this.vueFormConfig.Promise.all(_this.promises).then(function () {
_this.state._submit();
_this.$emit('submit', event);
_this.promises = [];
});
} else {
_this.state._submit();
_this.$emit('submit', event);
}
},
reset: function reset(event) {
_this.state._reset();
Expand Down Expand Up @@ -449,6 +458,12 @@ var vueForm = {

return _ref = {}, defineProperty(_ref, vueFormState, this.state), defineProperty(_ref, vueFormParentForm, this), _ref;
},

data: function data() {
return {
promises: []
};
},
created: function created() {
var _this2 = this;

Expand Down Expand Up @@ -751,7 +766,7 @@ var validate = {
},
debounce: Number
},
inject: { vueFormConfig: vueFormConfig, vueFormState: vueFormState },
inject: { vueFormConfig: vueFormConfig, vueFormState: vueFormState, vueFormParentForm: vueFormParentForm },
data: function data() {
return {
name: '',
Expand Down Expand Up @@ -932,6 +947,7 @@ var validate = {
} else {
pending.promises.push(result);
pending.names.push(validator);
vm.vueFormParentForm.promises.push(result);
}
});

Expand Down
Loading

0 comments on commit 464126a

Please sign in to comment.