Skip to content

Commit

Permalink
cascades time-only on timefield; adds data to submit event in core fo…
Browse files Browse the repository at this point in the history
…rm; fixes custom slots in tabs; cascades the errors object as computed prop;
  • Loading branch information
aocneanu committed Mar 23, 2019
1 parent 4ccd4d3 commit 3cc945a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/bulma/EnsoForm.vue
Expand Up @@ -64,6 +64,11 @@ export default {
? this.$refs.form.data
: [];
},
errors() {
return this.ready
? this.$refs.form.errors
: [];
},
},
methods: {
Expand Down
5 changes: 5 additions & 0 deletions src/bulma/VueForm.vue
Expand Up @@ -53,6 +53,11 @@ export default {
? this.$refs.coreForm.state.data
: [];
},
errors() {
return this.ready
? this.$refs.coreForm.errors
: [];
},
},
methods: {
Expand Down
1 change: 1 addition & 0 deletions src/bulma/fields/DateField.vue
Expand Up @@ -2,6 +2,7 @@
<datepicker v-model="field.value"
:is-danger="errors.has(field.name)"
:locale="locale"
:time-only="timeOnly"
v-bind="{ ...field.meta, placeholder: i18n(field.meta.placeholder) }"
v-on="$listeners"
@input="errors.clear(field.name)"
Expand Down
8 changes: 7 additions & 1 deletion src/bulma/parts/FormContent.vue
Expand Up @@ -3,7 +3,13 @@
<form-header/>
<form class="is-marginless">
<form-tabs v-on="$listeners"
v-if="state.data.tabs"/>
v-if="state.data.tabs">
<template v-for="field in customFields()"
v-slot:[field.name]>
<slot :name="field.name"
v-bind="fieldBindings(field)"/>
</template>
</form-tabs>
<template v-for="(section, index) in state.data.sections"
v-else>
<form-section :key="index"
Expand Down
2 changes: 1 addition & 1 deletion src/renderless/CoreForm.vue
Expand Up @@ -131,7 +131,7 @@ export default {
.then(({ data }) => {
this.loading = false;
this.$toastr.success(data.message);
this.$emit('submit');
this.$emit('submit', data);
if (data.redirect) {
this.$router.push({
Expand Down

0 comments on commit 3cc945a

Please sign in to comment.