Allow empty value in UserSelector
This commit is contained in:
parent
b2d54a046f
commit
50f1f028eb
|
@ -19,7 +19,7 @@ export default defineComponent({
|
||||||
name: 'UserSelector',
|
name: 'UserSelector',
|
||||||
props: {
|
props: {
|
||||||
label: { type: String, default: 'Benutzer' },
|
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 },
|
emits: { 'update:modelValue': (user: FG.User) => !!user },
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
|
@ -34,7 +34,7 @@ export default defineComponent({
|
||||||
const users = computed(() => store.state.users.users);
|
const users = computed(() => store.state.users.users);
|
||||||
const selected = computed({
|
const selected = computed({
|
||||||
get: () => props.modelValue,
|
get: () => props.modelValue,
|
||||||
set: (value: FG.User) => emit('update:modelValue', value),
|
set: (value: FG.User | undefined) => (value ? emit('update:modelValue', value) : undefined),
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue