更新记录
1.0.0(2025-05-14)
下载此版本
- 支持uni_modules目录规范
- 支持普通车牌和特殊车牌
- 支持新能源汽车车牌
- 全新自定义车牌键盘组件
平台兼容性
uni-app
Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
√ |
- |
- |
- |
√ |
- |
- |
- |
- |
微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
其他
king-licence-plate 普通车牌和特殊车牌组件,全新自定义车牌键盘组件
全平台兼容
H5 |
微信小程序 |
支付宝小程序 |
百度小程序 |
头条小程序 |
QQ 小程序 |
App |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
代码演示
插件demo
- king-licence-plate-demo 为 demo
- 位于 uni_modules/king-licence-plate/components/king-licence-plate-demo
- 导入插件后直接使用可查看demo
一、选择车牌组件使用方法
API
Props
参数 |
说明 |
类型 |
默认值 |
type |
车牌类型,1默认选中普通车牌 2特殊车牌 |
string |
- |
<template>
<!-- 选择车牌组件,uni_modules规范,不需额外引入注册 -->
<king-licence-plate></king-licence-plate>
</template>
<script>
export default {
data() {
return {
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
</style>
二、选择车牌键盘弹窗组件使用方法
API
Props
参数 |
说明 |
类型 |
默认值 |
popShow |
是否显示弹窗 |
boolean |
false |
plateIndex |
第几个车牌 |
number |
0 |
platePopClk |
车牌键盘选择点击方法 |
events |
- |
popClose |
关闭弹窗方法 |
Array |
- |
<template>
<view>
<view @click="show = true">点击我显示车牌号码选择弹窗</view>
<!-- 车牌键盘弹窗 -->
<CarNoPop :popShow.sync="show" :plateIndex="curIndex" @click="keyboardClk" @delete="keyboardDel" />
</view>
</template>
<script>
// 引入车牌键盘弹窗组件,这个路径以实际路径为准
import CarNoPop from './CarNoPop/index.vue'
export default {
components: {
CarNoPop,
},
data() {
return {
show: false,
}
},
destroyed() {
this.show = false
},
methods: {
// 键盘点击
keyboardClk(key) {
this.$set(this.plateList, this.curIndex, key)
if (this.curIndex < this.maxNum - 1) {
this.curIndex++
}
},
// 键盘删除
keyboardDel() {
const curValue = this.plateList[this.curIndex]
if (curValue) {
this.$set(this.plateList, this.curIndex, '')
} else if (this.curIndex > 0) {
this.curIndex--
}
},
},
}
</script>