WEB-新能源车牌输入键盘 ( jQuery版 & VUE 版)

效果:

在这里插入图片描述


思路:

1.初始化页面渲染车牌号显示框,点击框框时弹起键盘;
2.第一个框框为省份输入键盘,选择省份后动态添加一个类名class haspro,其他框框点击在有haspro时弹起数字键盘,否则始终弹起省份键盘;
3,功能性的 确定 后退 清除 以及 关闭按钮;
4.特殊验证 车牌第二位必须为字母,车牌号正则验证等;
5.有效点击时给对应的框框添加类名 active,通过这个class,结合强大的jquery过滤器选择器,可以实现诸如光标闪动效果,后退清空等等功能性方法;
6.layer 交互提示

VUE 版本 demo

keyBoard.vue 封装键盘

<template>
  <transition name="el-zoom-in-bottom" appear>
    <div
      class="absolute bottom-0 p-6 pt-0 keyboard-dialog"
      v-show="show"
      @click.stop="
        'javascript:void()';


      "
    >
      <ul
        class="flex flex-row flex-wrap justify-between p-0 mb-0 text-black list-none"
      >
        <li
          v-for="(item, index) in activeList"
          :key="index"
          :class="[
            'mt-3 leading-10 text-center bg-white cursor-pointer h-11',
            index >= 31 ? 'fix-margin' : '',
            activeIndex == 1 && index < 10
              ? 'opacity-50 cursor-not-allowed'
              : ''
          ]"
          :style="{ width: '9.1%' }"
          @click="
            activeIndex == 1 && index < 10
              ? 'javascript:void(0)'
              : handleInput(item)
          "
        >
          {
  
  { item }}
        </li>
        <li
          class="mt-3 leading-10 text-center cursor-pointer h-11 del "
          style="width:19.2%;"
          @click="handleDel"
        ></li>

        <li
          class="mt-3 leading-10 text-center text-white cursor-pointer h-11 bg-blue-dark"
          style="width:19.2%;margin-left:1%;"
          @click="handleConfirm"
        >
          完成
        </li>
      </ul>
    </div>
  </transition>
</template>

<script>
export default {
  name: "Keyboard",
  props: {
    activeIndex: {
      type: Number,
      default: -1
    }
  },
  data: () => ({
    show: false,
    province: new Array(
      "京",
      "沪",
      "浙",
      "苏",
      "粤",
      "鲁",
      "晋",
      "冀",
      "豫",
      "川",
      "渝"
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值