2
0
mirror of https://github.com/frappe/books.git synced 2024-09-21 03:39:02 +00:00
books/ui/components/controls/Check.vue
2018-07-12 16:59:10 +05:30

31 lines
723 B
Vue

<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"
:disabled="disabled"
>
<label class="custom-control-label" :for="id">{{ docfield.label }}</label>
</div>
</div>
</template>
<script>
import Base from './Base';
export default {
extends: Base,
data() {
return {
checkboxValue: Boolean(this.value)
}
},
methods: {
emitChange(e) {
this.$emit('change', Number(this.checkboxValue));
}
}
}
</script>