2020-10-02 14:17:10 +02:00
|
|
|
<template>
|
|
|
|
<div class="field">
|
2021-10-09 19:23:24 +02:00
|
|
|
<input :id="fieldName" type="checkbox" :name="fieldName" class="is-checkradio is-info" v-model="form[fieldName]" v-on:change="$emit(fieldName, form[fieldName])" >
|
2020-10-02 14:17:10 +02:00
|
|
|
<label :for="fieldName" class="label" v-html="label"></label>
|
|
|
|
<p class="help" v-html="help" v-if="help"></p>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'FormCheckbox',
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
label: {
|
|
|
|
type: String,
|
|
|
|
default: ''
|
|
|
|
},
|
|
|
|
|
|
|
|
fieldName: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
|
|
|
|
form: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
|
|
|
|
help: {
|
|
|
|
type: String,
|
|
|
|
default: ''
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|