Add IsDisabled option to Form and FormButtons components

This commit is contained in:
Bubka 2020-02-25 09:07:17 +01:00
parent 8391a1df15
commit 719c02e625
2 changed files with 8 additions and 2 deletions

View File

@ -11,6 +11,7 @@ class Form {
*/
constructor (data = {}) {
this.isBusy = false
this.isDisabled = false
// this.successful = false
this.errors = new Errors()
// this.originalData = deepCopy(data)
@ -268,6 +269,6 @@ class Form {
Form.routes = {}
Form.errorMessage = 'Something went wrong. Please try again.'
Form.ignore = ['isBusy', /*'successful'*/, 'errors', 'originalData']
Form.ignore = ['isBusy', 'isDisabled', 'errors', 'originalData']
export default Form

View File

@ -1,7 +1,7 @@
<template>
<div class="field is-grouped">
<div class="control">
<v-button :isLoading="isBusy" >{{ caption }}</v-button>
<v-button :isLoading="isBusy" :disabled="isDisabled" >{{ caption }}</v-button>
</div>
<div class="control" v-if="showCancelButton">
<router-link :to="{ name: cancelLandingView }" class="button is-text">{{ $t('commons.cancel') }}</router-link>
@ -30,6 +30,11 @@
default: false
},
isDisabled: {
type: Boolean,
default: false
},
caption: {
type: String,
default: 'Submit'