index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <div class="d-flex align-center">
  3. <div class="mr-5 color-999" :style="`width: ${item.width || 120}px;`">{{ item.label }}</div>
  4. <v-checkbox
  5. v-model="value"
  6. v-for="k in item.items"
  7. :key="k.key"
  8. :label="k.label"
  9. :value="k.value"
  10. :disabled="k.disabled"
  11. :color="item.color || 'primary'"
  12. :density="k.density || 'compact'"
  13. :multiple="k.multiple === false ? false : true"
  14. class="mr-3"
  15. hide-details
  16. @update:modelValue="modelValueUpDate"
  17. ></v-checkbox>
  18. </div>
  19. </template>
  20. <script setup>
  21. import { ref } from 'vue';
  22. defineOptions({ name:'FormUI-v-checkbox'})
  23. const props = defineProps({item: Object, modelValue: Array})
  24. const emit = defineEmits(['update:modelValue', 'change'])
  25. const item = props.item
  26. const value = ref(props.modelValue)
  27. const modelValueUpDate = (val) => {
  28. value.value = val
  29. emit('update:modelValue', value.value)
  30. emit('change', value.value)
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. // :deep(.v-input__control) {
  35. // flex-direction: row !important;
  36. // }
  37. // :deep(.v-selection-control-group) {
  38. // margin-top: 0 !important;
  39. // }
  40. // :deep(.v-label) {
  41. // margin-left: 0 !important;
  42. // }
  43. </style>