FaCarNumber
Combines ElInput with a province, letter and digit keyboard. Supports standard and new-energy license plate validation and integrates with ElForm validation.
Car Number
View code
<template>
<div class="demo-stack">
<FaCarNumber v-model="carNumber" clearable style="max-width: 360px" />
<FaCarNumber model-value="粤B12345" disabled style="max-width: 360px" />
<span class="demo-value">当前车牌:{{ carNumber ?? "未选择" }}</span>
</div>
</template>
<script setup lang="ts">
import { ref } from "vue";
const carNumber = ref<string | null>("粤B12345");
</script>FaCarNumber Complete API
Combines ElInput with a license-plate keyboard. Only listed Input props are forwarded; ElInput slots/expose are not.
Props (33)
Fast and Element Plus 2.14.6 props are merged below. Fast changes appear first; native props that are not forwarded remain visible for compatibility review.
| Property | Source | Description | Type | Default |
|---|---|---|---|---|
modelValue | Fast override | v-model value. | String | Fast—EL"" |
formatter | Fast override | Display-value formatter. | Function | Fast—EL— |
parser | Fast override | Parses displayed input before writing the model. | Function | Fast—EL— |
placeholder | Fast override | Placeholder. | String | Fast请选择EL— |
readonly | Fast override | Display the input value as readonly. | Boolean | FastfalseELfalse |
showWordLimit | Fast override | whether show word count, only works when type is 'text' or 'textarea' | Boolean | FastfalseELtrue |
id | EL native | Native ID of the root input. | String | — |
size | EL native | Component size. | String | — |
disabled | EL native | Disable the component or current option. | Boolean | false |
modelModifiers | EL native | v-model modifiers, reference Vue modifiers | Object | {} |
maxlength | EL native | same as maxlength in native input | String / Number | — |
minlength | EL native | same as minlength in native input | String / Number | — |
type | EL native | Native input type. | String | text |
resize | EL native | control the resizability | String | — |
autosize | EL native | whether textarea has an adaptive height, only works when type is 'textarea'. Can accept an object, e.g. { minRows: 2, maxRows: 6 } | Boolean / Object | false |
autocomplete | EL native | Native input autocomplete attribute. | String | off |
form | EL native | same as form in native input | String | — |
clearable | EL native | Allow clearing. | Boolean | false |
clearIcon | EL native | Clear-button icon. | String / Object / Function | {"name":"CircleClose","__name":"circle-close"} |
showPassword | EL native | whether to show toggleable password input | Boolean | false |
wordLimitPosition | EL native | word count position, valid when show-word-limit is true | String | inside |
suffixIcon | EL native | Selector suffix icon. | String / Object / Function | — |
prefixIcon | EL native | prefix icon component | String / Object / Function | — |
containerRole | EL native | ARIA role for the input-group container. | String | — |
tabindex | EL native | Native input tabindex. | String / Number | 0 |
validateEvent | EL native | Trigger form validation on model changes. | Boolean | true |
inputStyle | EL native | the style of the input element or textarea element | Object / Array / String / Boolean | {} |
countGraphemes | EL native | custom function to count graphemes; when set, native maxlength/minlength constraints are bypassed. Component uses Intl.Segmenter (Chrome 87+, Firefox 125+, Safari 14.1+) for proper grapheme clustering; older browsers fall back to Array.from() for code-point iteration | Function | — |
autofocus | EL native | same as autofocus in native input | Boolean | false |
rows | EL native | number of rows of textarea, only works when type is 'textarea' | Number | 2 |
ariaLabel | EL native | Accessible component name. | String | — |
inputmode | EL native | same as inputmode in native input | String | — |
name | EL native | Icon name, CSS class, or external SVG URL. | String | — |
Events(12)
| Name | Source | Description | Parameters / type |
|---|---|---|---|
update:modelValue | EL native | Updates v-model. | — |
change | EL native | Value or selection changes. | — |
blur | EL native · not forwarded | triggers when Input blurs | — |
focus | EL native · not forwarded | triggers when Input focuses | — |
input | EL native · not forwarded | triggers when the Input value change | — |
clear | EL native · not forwarded | triggers when the Input is cleared by clicking the clear button | — |
keydown | EL native · not forwarded | triggers when a key is pressed down | — |
mouseleave | EL native · not forwarded | triggers when the mouse leaves the Input element | — |
mouseenter | EL native · not forwarded | triggers when the mouse enters the Input element | — |
compositionstart | EL native · not forwarded | triggers when the composition starts | — |
compositionupdate | EL native · not forwarded | triggers when the composition is updated | — |
compositionend | EL native · not forwarded | triggers when the composition ends | — |
Slots(5)
| Name | Source | Description | Parameters / type |
|---|---|---|---|
prefix | EL native · not forwarded | content as Input prefix, only works when type is not 'textarea' | — |
suffix | EL native · not forwarded | content as Input suffix, only works when type is not 'textarea' | — |
prepend | EL native · not forwarded | content to prepend before Input, only works when type is not 'textarea' | — |
append | EL native · not forwarded | content to append after Input, only works when type is not 'textarea' | — |
password-icon | EL native · not forwarded | content as Input password icon, only works when show-password is true. The scope variable is { visible: boolean } | — |
Expose(10)
| Name | Source | Description | Parameters / type |
|---|---|---|---|
input | EL native · not forwarded | ElInput internal input ref. | — |
textarea | EL native · not forwarded | ElInput internal textarea ref. | — |
ref | EL native · not forwarded | Underlying Element Plus component ref. | — |
textareaStyle | EL native · not forwarded | Calculated ElInput textarea styles. | — |
autosize | EL native · not forwarded | Current input autosize settings. | — |
focus | EL native · not forwarded | Focuses the input/selector. | — |
blur | EL native · not forwarded | Blurs the input/selector. | — |
select | EL native · not forwarded | Selects all ElInput text. | — |
clear | EL native · not forwarded | Clears the current selected value. | — |
resizeTextarea | EL native · not forwarded | Recalculates textarea height. | — |
