size
Validates that the value's size exactly equals a given value.
Usage
vue
<VfText name="code" label="Invite code" rules="size:6" />vue
<template>
<VfText name="code" label="Invite code" rules="size:6" />
</template>ts
{
code: {
type: 'text',
label: 'Invite code',
rules: 'size:6',
},
}Parameters
| Parameter | Description |
|---|---|
size | The exact size. |
Behavior
How size is measured depends on the element type:
- String — the character count
- Numeric — the numeric value itself
- Array — the number of items
- File — the file size in kilobytes
Error Messages
| Key | Default Message |
|---|---|
rule_size_string_error | The {attribute} must be {size} characters. |
rule_size_numeric_error | The {attribute} must be {size}. |
rule_size_array_error | The {attribute} must contain {size} items. |
rule_size_file_error | The {attribute} must be {size} kilobytes. |