refactor: handle gender and prefixName
This commit is contained in:
parent
970f27b714
commit
2b0587c116
2 changed files with 138 additions and 2 deletions
|
|
@ -53,6 +53,11 @@ let nationalityFilter: (
|
|||
update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
|
||||
) => void;
|
||||
|
||||
function matPreFixName() {
|
||||
if (gender.value === 'male') prefixName.value = 'mr';
|
||||
else prefixName.value = 'mrs';
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
prefixNameFilter = selectFilterOptionRefMod(
|
||||
ref(optionStore.globalOption?.prefix),
|
||||
|
|
@ -100,6 +105,14 @@ watch(
|
|||
else if (v !== '') gender.value = 'female';
|
||||
},
|
||||
);
|
||||
|
||||
watch(
|
||||
() => gender.value,
|
||||
() => {
|
||||
if (props.readonly) return;
|
||||
matPreFixName();
|
||||
},
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<div class="row col-12">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue