2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

Add disabled attribute to fields

This commit is contained in:
Faris Ansari 2018-07-12 16:59:10 +05:30
parent ea441c240b
commit 8c9eb126a4
5 changed files with 14 additions and 13 deletions

View File

@ -1,7 +1,12 @@
<template>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" :id="id" v-model="checkboxValue" @change="emitChange">
<input class="custom-control-input" type="checkbox"
:id="id"
v-model="checkboxValue"
@change="emitChange"
:disabled="disabled"
>
<label class="custom-control-label" :for="id">{{ docfield.label }}</label>
</div>
</div>

View File

@ -1,19 +1,12 @@
<template>
<div class="form-group" v-if="!onlyInput">
<label>{{ docfield.label }}</label>
<div :class="{'form-group': !onlyInput}">
<label v-if="!onlyInput">{{ docfield.label }}</label>
<flat-pickr
:value="value"
class="form-control"
@on-change="emitChange">
</flat-pickr>
</div>
<flat-pickr
v-else
:value="value"
class="form-control"
@on-change="emitChange"
>
</flat-pickr>
</template>
<script>
import flatPickr from 'vue-flatpickr-component';

View File

@ -38,7 +38,8 @@ export default {
id: this.id,
type: 'file',
value: this.value,
required: this.docfield.required
required: this.docfield.required,
disabled: this.disabled
}
}
}

View File

@ -10,7 +10,8 @@ export default {
id: this.id,
type: 'password',
value: this.value,
required: this.docfield.required
required: this.docfield.required,
disabled: this.disabled
};
},
}

View File

@ -9,7 +9,8 @@ export default {
getInputAttrs() {
return {
id: this.id,
required: this.docfield.required
required: this.docfield.required,
disabled: this.disabled
};
},
getInputChildren(h) {