0
0
Fork 0

nullishToTrue fn

This commit is contained in:
Alex Moreno 2024-08-01 09:47:38 +02:00
parent 5233c1455a
commit d9fb0d9186
1 changed files with 9 additions and 5 deletions

View File

@ -183,6 +183,10 @@ async function filterHandler(val, update) {
} }
); );
} }
function nullishToTrue(value) {
return value ?? true;
}
</script> </script>
<template> <template>
@ -202,11 +206,11 @@ async function filterHandler(val, update) {
:option-value="optionValue" :option-value="optionValue"
v-bind="$attrs" v-bind="$attrs"
@filter="filterHandler" @filter="filterHandler"
:emit-value="$attrs['emit-value'] ?? true" :emit-value="nullishToTrue($attrs['emit-value'])"
:map-options="$attrs['map-options'] ?? true" :map-options="nullishToTrue($attrs['map-options'])"
:use-input="$attrs['use-input'] ?? true" :use-input="nullishToTrue($attrs['use-input'])"
:hide-selected="$attrs['hide-selected'] ?? true" :hide-selected="nullishToTrue($attrs['hide-selected'])"
:fill-input="$attrs['fill-input'] ?? true" :fill-input="nullishToTrue($attrs['fill-input'])"
ref="vnSelectRef" ref="vnSelectRef"
lazy-rules lazy-rules
:class="{ required: $attrs.required }" :class="{ required: $attrs.required }"