feat: use withDefaults for SelectUser
This commit is contained in:
parent
b0c41ca436
commit
b500981434
@ -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[]>([])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user