- prettier formatting
All checks were successful
CI Pipeline / japa-tests (push) Successful in 51s

- npm updates
- new SearchMap.vue component
This commit is contained in:
Kaimbacher 2023-10-31 15:38:43 +01:00
parent 7bc9f90cca
commit a7142f694f
74 changed files with 3360 additions and 3577 deletions

View file

@ -2,50 +2,42 @@
import { computed } from 'vue';
const props = defineProps({
name: {
type: String,
required: true
},
type: {
type: String,
default: 'checkbox',
validator: value => ['checkbox', 'radio', 'switch'].includes(value)
},
label: {
type: String,
default: null
},
modelValue: {
type: [Array, String, Number, Boolean],
default: null
},
inputValue: {
type: [String, Number, Boolean],
required: true
}
})
const emit = defineEmits(['update:modelValue'])
name: {
type: String,
required: true,
},
type: {
type: String,
default: 'checkbox',
validator: (value) => ['checkbox', 'radio', 'switch'].includes(value),
},
label: {
type: String,
default: null,
},
modelValue: {
type: [Array, String, Number, Boolean],
default: null,
},
inputValue: {
type: [String, Number, Boolean],
required: true,
},
});
const emit = defineEmits(['update:modelValue']);
const computedValue = computed({
get: () => props.modelValue,
set: value => {
emit('update:modelValue', value)
}
})
const inputType = computed(() => props.type === 'radio' ? 'radio' : 'checkbox')
get: () => props.modelValue,
set: (value) => {
emit('update:modelValue', value);
},
});
const inputType = computed(() => (props.type === 'radio' ? 'radio' : 'checkbox'));
</script>
<template>
<label
:class="type"
class="mr-6 mb-3 last:mr-0"
>
<input
v-model="computedValue"
:type="inputType"
:name="name"
:value="inputValue"
>
<span class="check" />
<span class="pl-2">{{ label }}</span>
</label>
</template>
<label :class="type" class="mr-6 mb-3 last:mr-0">
<input v-model="computedValue" :type="inputType" :name="name" :value="inputValue" />
<span class="check" />
<span class="pl-2">{{ label }}</span>
</label>
</template>