|
@@ -0,0 +1,41 @@
|
|
|
+<template>
|
|
|
+ <v-checkbox
|
|
|
+ v-model="value"
|
|
|
+ v-for="k in item.items"
|
|
|
+ :key="k.key"
|
|
|
+ :label="k.label"
|
|
|
+ :value="k.value"
|
|
|
+ :disabled="k.disabled"
|
|
|
+ :color="item.color || 'primary'"
|
|
|
+ :density="k.density || 'compact'"
|
|
|
+ :multiple="k.multiple === false ? false : true"
|
|
|
+ class="mr-3"
|
|
|
+ hide-details
|
|
|
+ @update:modelValue="modelValueUpDate"
|
|
|
+ ></v-checkbox>
|
|
|
+</template>
|
|
|
+<script setup>
|
|
|
+import { ref, defineEmits } from 'vue';
|
|
|
+defineOptions({ name:'FormUI-v-checkbox'})
|
|
|
+
|
|
|
+const props = defineProps({item: Object, modelValue: [String, Number, Boolean]})
|
|
|
+const emit = defineEmits(['update:modelValue', 'change'])
|
|
|
+const item = props.item
|
|
|
+const value = ref(props.modelValue)
|
|
|
+const modelValueUpDate = (val) => {
|
|
|
+ value.value = val
|
|
|
+ emit('update:modelValue', value.value)
|
|
|
+ emit('change', value.value)
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+// :deep(.v-input__control) {
|
|
|
+// flex-direction: row !important;
|
|
|
+// }
|
|
|
+// :deep(.v-selection-control-group) {
|
|
|
+// margin-top: 0 !important;
|
|
|
+// }
|
|
|
+// :deep(.v-label) {
|
|
|
+// margin-left: 0 !important;
|
|
|
+// }
|
|
|
+</style>
|