FormCheckbox.vue 898 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <div class="field">
  3. <input :id="fieldName" type="checkbox" :name="fieldName" class="is-checkradio is-info" v-model="form[fieldName]">
  4. <label :for="fieldName" class="label" v-html="label"></label>
  5. <p class="help" v-html="help" v-if="help"></p>
  6. </div>
  7. </template>
  8. <script>
  9. export default {
  10. name: 'FormCheckbox',
  11. data() {
  12. return {
  13. }
  14. },
  15. props: {
  16. label: {
  17. type: String,
  18. default: ''
  19. },
  20. fieldName: {
  21. type: String,
  22. default: '',
  23. required: true
  24. },
  25. form: {
  26. type: Object,
  27. required: true
  28. },
  29. help: {
  30. type: String,
  31. default: ''
  32. },
  33. }
  34. }
  35. </script>