1.0.5 • Published 12 months ago

vue-license-plate v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

vue-license-plate

介绍

  • vue-license-plate是一款基于vue2的车牌号输入控件。

vue3版本

vue3-license-plate

微信小程序版本

mp-license-plate

项目中使用

  • 下载
npm install vue-license-plate
  • 在main.js中加入
import LicensePlate from 'vue-license-plate'
import 'vue-license-plate/lib/licensePlate.css'
Vue.use(LicensePlate);
  • 在需要的页面中使用
licensePlate: "川A00001"

<LicensePlate v-model="licensePlate" @change="change"></LicensePlate>

change(val){
	console.log(val.array)	//数组形式
	console.log(val.value)	//字符串形式
	console.log(val.pass)	  //是否验证通过
}
  • 自定义车牌展示
<LicensePlate :borderRadius="6"
							@change="changeVal"
							v-model="licensePlate"
							:autoShow="false">
						<div class="custom">{{ licensePlate }}</div>
</LicensePlate>
//自定义时 borderColor borderActiveColor borderWidth borderRadius  fontColor fontSize 无效
//自定义时点击事件根据当前长度计算,即默认选中最后一位
  • 展示如下

npm.io

API

Props

名字类型默认值说明
v-modelString""默认车牌号
autoShowBooleanfalse自动展示键盘
borderColorString#79aef3输入框边框颜色
borderActiveColorString#330aec输入框选中的边框颜色
borderWidthNumber1边框宽度
borderRadiusNumber6边框圆角
fontColorString#333333文字颜色
fontSizeNumber16文字大小

Events

名字说明回调参数
@change输入改变时触发{array:[],value:string,pass:false}

Change Log

  • 1.0.5

1、增加 '警'、'挂' 2、支持车牌slot

  • 1.0.4

自动展示键盘

  • 1.0.3

修复文档错误

  • 1.0.2

替换资源文件为icon

  • 1.0.1

修复bug

  • 1.0.0

首次发版

License

MIT

1.0.5

12 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago