UserSelector: Allow custom label

This commit is contained in:
Ferdinand Thiessen 2021-01-20 15:45:13 +01:00
parent 08c29c1cd6
commit 7748d2d8a3
1 changed files with 7 additions and 6 deletions

View File

@ -1,9 +1,9 @@
<template>
<q-select
filled
label="Benutzer"
:label="label"
@input="updated"
v-model="user"
:value="user"
:options="users"
option-label="display_name"
option-value="userid"
@ -18,16 +18,17 @@ import { StateInterface } from 'src/store';
interface Props {
user: FG.User;
label: string;
}
export default defineComponent({
name: 'UserSelector',
props: ['user'],
props: { user: { required: true }, label: { type: String, default: 'Benutzer' } },
setup(props: Props, { root, emit }) {
const store = <Store<StateInterface>>root.$store;
onBeforeMount(() => {
store.dispatch('user/getUsers').catch((error) => {
store.dispatch('user/getUsers').catch(error => {
console.error(error);
});
});
@ -39,8 +40,8 @@ export default defineComponent({
return {
updated,
users,
users
};
},
}
});
</script>