1
0

feat: use withDefaults for SelectUser

This commit is contained in:
Dominik Pschenitschni 2024-06-26 20:21:21 +02:00 committed by konrad
parent b0c41ca436
commit b500981434

View File

@ -11,7 +11,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {computed, ref, shallowReactive, watchEffect, type PropType} from 'vue' import {computed, ref, shallowReactive, watchEffect} from 'vue'
import Multiselect from '@/components/input/Multiselect.vue' import Multiselect from '@/components/input/Multiselect.vue'
@ -20,14 +20,14 @@ import type {IUser} from '@/modelTypes/IUser'
import UserService from '@/services/user' import UserService from '@/services/user'
import {includesById} from '@/helpers/utils' import {includesById} from '@/helpers/utils'
const props = defineProps({ const props = withDefaults(defineProps<{
modelValue: { modelValue: IUser[] | undefined
type: Array as PropType<IUser[]>, }>(), {
default: () => [], modelValue: () => [],
},
}) })
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'update:modelValue', value: IUser[]): void 'update:modelValue': [value: IUser[]]
}>() }>()
const users = ref<IUser[]>([]) const users = ref<IUser[]>([])