release v2.0.0 #4
|
@ -19,7 +19,7 @@ export default defineComponent({
|
|||
name: 'UserSelector',
|
||||
props: {
|
||||
label: { type: String, default: 'Benutzer' },
|
||||
modelValue: { required: true, type: Object as PropType<FG.User> },
|
||||
modelValue: { default: undefined, type: Object as PropType<FG.User | undefined> },
|
||||
},
|
||||
emits: { 'update:modelValue': (user: FG.User) => !!user },
|
||||
setup(props, { emit }) {
|
||||
|
@ -34,7 +34,7 @@ export default defineComponent({
|
|||
const users = computed(() => store.state.users.users);
|
||||
const selected = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value: FG.User) => emit('update:modelValue', value),
|
||||
set: (value: FG.User | undefined) => (value ? emit('update:modelValue', value) : undefined),
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue