Skip to content

FaCarNumber 车牌输入

组合 ElInput 与省份、字母、数字车牌键盘,支持普通车牌和新能源车牌校验,并自动接入 ElForm 校验。

车牌选择、清空与禁用状态

查看代码
Vue
<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 完整 API

基于 ElInput 组合车牌键盘;除表中列出的 Input Props 外,不透传 ElInput 插槽和 Expose。

Props 属性 (33)

Fast 与 Element Plus 2.14.6 的属性已合并展示;Fast 修改项优先排列,未透传的原生属性保留用于兼容性核对。

属性来源说明类型默认值
modelValueFast 修改v-model 绑定值。StringFastEL""
formatterFast 修改显示值格式化函数。FunctionFastEL
parserFast 修改输入值解析函数,在写入模型前转换显示文本。FunctionFastEL
placeholderFast 修改占位提示。StringFast请选择EL
readonlyFast 修改是否以只读方式展示输入值。BooleanFastfalseELfalse
showWordLimitFast 修改whether show word count, only works when type is 'text' or 'textarea'BooleanFastfalseELtrue
idEL 原生组件根输入元素的原生 id。String
sizeEL 原生组件尺寸。String
disabledEL 原生是否禁用组件或当前选项。Booleanfalse
modelModifiersEL 原生v-model modifiers, reference Vue modifiersObject{}
maxlengthEL 原生same as maxlength in native inputString / Number
minlengthEL 原生same as minlength in native inputString / Number
typeEL 原生输入框原生类型。Stringtext
resizeEL 原生control the resizabilityString
autosizeEL 原生whether textarea has an adaptive height, only works when type is 'textarea'. Can accept an object, e.g. { minRows: 2, maxRows: 6 }Boolean / Objectfalse
autocompleteEL 原生输入框原生 autocomplete 属性。Stringoff
formEL 原生same as form in native inputString
clearableEL 原生是否允许清空。Booleanfalse
clearIconEL 原生清空按钮使用的图标组件。String / Object / Function{"name":"CircleClose","__name":"circle-close"}
showPasswordEL 原生whether to show toggleable password inputBooleanfalse
wordLimitPositionEL 原生word count position, valid when show-word-limit is trueStringinside
suffixIconEL 原生选择器右侧显示的后缀图标组件。String / Object / Function
prefixIconEL 原生prefix icon componentString / Object / Function
containerRoleEL 原生输入组合容器的 ARIA role。String
tabindexEL 原生组件输入元素的原生 tabindex。String / Number0
validateEventEL 原生模型值变化时是否触发表单校验。Booleantrue
inputStyleEL 原生the style of the input element or textarea elementObject / Array / String / Boolean{}
countGraphemesEL 原生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 iterationFunction
autofocusEL 原生same as autofocus in native inputBooleanfalse
rowsEL 原生number of rows of textarea, only works when type is 'textarea'Number2
ariaLabelEL 原生组件面向辅助技术的可访问名称。String
inputmodeEL 原生same as inputmode in native inputString
nameEL 原生图标名称、CSS 类名或外部 SVG 地址。String
Events 事件(12)
名称来源说明参数 / 类型
update:modelValueEL 原生更新 v-model。
changeEL 原生值或选择发生变化。
blurEL 原生 · 未透传triggers when Input blurs
focusEL 原生 · 未透传triggers when Input focuses
inputEL 原生 · 未透传triggers when the Input value change
clearEL 原生 · 未透传triggers when the Input is cleared by clicking the clear button
keydownEL 原生 · 未透传triggers when a key is pressed down
mouseleaveEL 原生 · 未透传triggers when the mouse leaves the Input element
mouseenterEL 原生 · 未透传triggers when the mouse enters the Input element
compositionstartEL 原生 · 未透传triggers when the composition starts
compositionupdateEL 原生 · 未透传triggers when the composition is updated
compositionendEL 原生 · 未透传triggers when the composition ends
Slots 插槽(5)
名称来源说明参数 / 类型
prefixEL 原生 · 未透传content as Input prefix, only works when type is not 'textarea'
suffixEL 原生 · 未透传content as Input suffix, only works when type is not 'textarea'
prependEL 原生 · 未透传content to prepend before Input, only works when type is not 'textarea'
appendEL 原生 · 未透传content to append after Input, only works when type is not 'textarea'
password-iconEL 原生 · 未透传content as Input password icon, only works when show-password is true. The scope variable is { visible: boolean }
Expose 暴露(10)
名称来源说明参数 / 类型
inputEL 原生 · 未透传ElInput 内部 input 元素引用。
textareaEL 原生 · 未透传ElInput 内部 textarea 元素引用。
refEL 原生 · 未透传底层 Element Plus 组件引用。
textareaStyleEL 原生 · 未透传ElInput 计算后的 textarea 样式。
autosizeEL 原生 · 未透传当前输入框的自动高度配置。
focusEL 原生 · 未透传让输入或选择组件获得焦点。
blurEL 原生 · 未透传让输入或选择组件失去焦点。
selectEL 原生 · 未透传选中 ElInput 中的全部文本。
clearEL 原生 · 未透传清空当前选择值。
resizeTextareaEL 原生 · 未透传重新计算 textarea 高度。