fix(03): form validate rule and i18n
This commit is contained in:
parent
aa42f1dcfc
commit
effa640c6d
3 changed files with 33 additions and 23 deletions
|
|
@ -344,8 +344,11 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
|||
:label="$t('customer.form.firstNameEN')"
|
||||
for="input-first-name-en"
|
||||
v-model="firstNameEN"
|
||||
:rules="[(val) => /^[A-Za-z]+$/.test(val)]"
|
||||
:error-message="$t('form.error.letterOnly')"
|
||||
:rules="[
|
||||
(val: string) => !!val || $t('form.error.required'),
|
||||
(val: string) =>
|
||||
/^[A-Za-z]+$/.test(val) || $t('form.error.letterOnly'),
|
||||
]"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
|
|
@ -356,8 +359,11 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
|||
:label="$t('customer.form.lastNameEN')"
|
||||
for="input-last-name-en"
|
||||
v-model="lastNameEN"
|
||||
:rules="[(val) => /^[A-Za-z]+$/.test(val)]"
|
||||
:error-message="$t('form.error.letterOnly')"
|
||||
:rules="[
|
||||
(val: string) => !!val || $t('form.error.required'),
|
||||
(val: string) =>
|
||||
/^[A-Za-z]+$/.test(val) || $t('form.error.letterOnly'),
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue