Skip to content

dongj0316/keyboard-license-plate

Repository files navigation

keyboard-license-plate

vue车牌号模拟键盘

online demo

Installation

Use

$ npm install keyboard-license-plate -S
import Vue from 'vue'
import KeyboardLicensePlate from 'keyboard-license-plate'

Vue.use(KeyboardLicensePlate)
<keyboard-license-plate ref="keyboard" v-model="licensePlateNumber"/>

API

component attributes:

Attr. Name Type Description Required Default Value
value String 绑定值 N -
placeholder String 占位文本 N 车牌号码
default-province String 车牌号首位默认值 N
z-index Number 键盘z-index样式值 N 5000
disabled-keys Array 禁用按钮值 N ['I', 'O']

instance methods:

  • focus() 获取焦点
  • blur() 取消焦点

instance attributes:

  • valid 布尔值,表示车牌号码格式是否正确

Local setup

npm install
npm run serve

License

MIT