refactor: hq abbrev rule
This commit is contained in:
parent
bcc27580b9
commit
b617acfc38
1 changed files with 5 additions and 2 deletions
|
|
@ -55,9 +55,12 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
||||||
for="input-abbreviation"
|
for="input-abbreviation"
|
||||||
:model-value="view ? formatCode(abbreviation, 'code') : abbreviation"
|
:model-value="view ? formatCode(abbreviation, 'code') : abbreviation"
|
||||||
:rules="[
|
:rules="[
|
||||||
|
(val) => (val && val.length > 0) || $t('form.error.required'),
|
||||||
(val) =>
|
(val) =>
|
||||||
(val && val.length > 0 && /^[a-zA-Z]+$/.test(val)) ||
|
(val && val.length > 0 && /^[a-zA-Z]+$/.test(val)) ||
|
||||||
$t('form.error.invalid'),
|
$t('form.error.invalidCustomeMessage', {
|
||||||
|
msg: $t('form.error.letterOnly'),
|
||||||
|
}),
|
||||||
]"
|
]"
|
||||||
@update:model-value="(v) => (abbreviation = v as string)"
|
@update:model-value="(v) => (abbreviation = v as string)"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue