最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

使用Vue實現(xiàn)簡易的車牌輸入鍵盤

 更新時間:2023年11月28日 11:08:29   作者:大陽光男孩  
這篇文章主要為大家詳細介紹了如何使用Vue實現(xiàn)簡易的車牌輸入鍵盤效果,文中的示例代碼講解詳細,具有一定的學(xué)習(xí)價值,感興趣的小伙伴可以了解下

效果圖如下:

代碼如下:

<template>
  <div>
    <div class="carNoBoxInput">
      <div style="padding: 6px;border: 2px solid #fff;border-radius: 6px;margin: 6px 3px 6px 6px;">
        <input class="inputBox" :value="licensePlateUnit[0]" @click="licensePlateDoor = true"/>
        <input class="inputBox" :value="licensePlateUnit[1]" @click="licensePlateDoor = true"/>
        <span class="dot"></span>
        <input class="inputBox" :value="licensePlateUnit[2]" @click="licensePlateDoor = true"/>
        <input class="inputBox" :value="licensePlateUnit[3]" @click="licensePlateDoor = true"/>
        <input class="inputBox" :value="licensePlateUnit[4]" @click="licensePlateDoor = true"/>
        <input class="inputBox" :value="licensePlateUnit[5]" @click="licensePlateDoor = true"/>
        <input class="inputBox" :value="licensePlateUnit[6]" @click="licensePlateDoor = true"/>
        <input v-if="7 === licensePlateUnit.length - 1" class="inputBox" :class="7 === licensePlateUnit.length - 1 ? 'inputBoxActive' : 'inputBox'" :value="licensePlateUnit[7]"/>
        <img v-if="7 !== licensePlateUnit.length - 1" src="../assets/newEnergy.png" style="height: 36px;width: 36px;"  alt="新能源"/>
      </div>
    </div>
    <div v-if="licensePlateDoor">
      <div v-if="licensePlateUnit.length < 1" class="carNoBox">
        <span class="carNo" v-for="item in columns" :key="item" @click="pickOn(item)">
          {{item}}
        </span>
        <span class="delBt" @click="delCarNo">X</span>
      </div>
      <div v-if="licensePlateUnit.length >= 1" class="carNoBox">
      <span class="carNo" v-for="item in numberColumns" :key="item" @click="pickOn(item)">
        {{item}}
      </span>
        <div style="display: flex;align-items: center">
          <span class="delBt" @click="delCarNo">X</span>
          <span class="delBt" style="margin-left: 6px;width: 42px" @click="confirm">確認</span>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
 
 
 
export default {
  data() {
    return {
      licensePlateDoor: false,
      activeIndex: 0,
      licensePlateUnit: [],
      columns: [//省縮寫選擇
        '京', '滬', '鄂', '湘', '川', '渝', '粵', '閩', '晉', '黑',
 
        '津', '浙', '豫', '贛', '貴', '青', '瓊', '寧', '吉', '蒙',
 
        '冀', '蘇', '皖', '桂', '云', '陜', '甘', '藏', '新', '遼',
        '魯'],
      numberColumns: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0','Q', 'W', 'E',
        'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
        'X', 'C', 'V', 'B', 'N', 'M', '港','澳','學(xué)','領(lǐng)','警'
      ],
    }
  },
  methods: {
    pickOn(value) {
      this.licensePlateDoor = true;
      if (this.licensePlateUnit.length <= 7) {
        this.licensePlateUnit.push(value)
      }
    },
    delCarNo() {
      this.licensePlateUnit.pop();
    },
    confirm() {
      if(this.licensePlateUnit.length >= 7) {
        console.log("車牌是:"+this.licensePlateUnit.join(''));
        this.licensePlateDoor = false;
      }
    },
  }
}
</script>
 
 
<style scoped>
  .carNo {
    border-radius: 6px;
    background: #fff;
    font-weight: bold;
    font-size: 20px;
    height: 28px;
    width:28px;
    margin: 6px;
    padding: 12px;
    cursor: pointer;
  }
  .inputBox {
    color: white;
    height: 30px;
    line-height: 30px;
    width: 30px;
    font-size: 28px;
    text-align: center;
    background-color: transparent;
    border: none;
    outline: none;
    caret-color: rgba(0, 0, 0, 0)
  }
  input:focus {
    border-bottom: 3px solid #fff;
    transition: all 0.5s;
  }
  .dot {
    margin-bottom: 6px;
    background-color: #fff;
    height: 6px;
    width: 6px;
    border-radius: 50%;
    display: inline-block
  }
  .delBt {
    background: #ACB3BB;
    border-radius: 6px;
    display: inline-block;
    font-weight: bold;
    font-size: 20px;
    height: 28px;
    width:28px;
    margin: 6px;
    padding: 12px;
    cursor: pointer;
  }
  .carNoBoxInput {
    display: flex;
    width: 310px;
    align-items: center;
    //height: 80px;
    border-radius: 8px;
    margin: 12px 0;
    background: #2D66D8;
  }
  .carNoBox {
    background: #D0D5D9;
    position: relative;
    width: 600px;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    justify-items: center;
    align-items: center
  }
</style>

到此這篇關(guān)于使用Vue實現(xiàn)簡易的車牌輸入鍵盤的文章就介紹到這了,更多相關(guān)Vue車牌輸入鍵盤內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Vue簡單實現(xiàn)原理詳解

    Vue簡單實現(xiàn)原理詳解

    這篇文章主要介紹了Vue簡單實現(xiàn)原理,結(jié)合實例形式詳細分析了Vue實現(xiàn)原理與操作注意事項,需要的朋友可以參考下
    2020-05-05
  • element-ui循環(huán)顯示radio控件信息的方法

    element-ui循環(huán)顯示radio控件信息的方法

    今天小編就為大家分享一篇element-ui循環(huán)顯示radio控件信息的方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-08-08
  • vue+axios實現(xiàn)圖片上傳識別人臉的示例代碼

    vue+axios實現(xiàn)圖片上傳識別人臉的示例代碼

    本文主要介紹了vue+axios實現(xiàn)圖片上傳識別人臉,這里采用的是vant的文件上傳組件,通過上傳圖片后端識別圖片里的人臉,感興趣的可以了解一下
    2021-11-11
  • vue中keep-alive組件的用法示例

    vue中keep-alive組件的用法示例

    眾所周知keep-alive是Vue提供的一個抽象組件,主要是用來對組件進行緩存,從而做到節(jié)省性能,這篇文章主要給大家介紹了關(guān)于vue中keep-alive組件用法的相關(guān)資料,需要的朋友可以參考下
    2021-05-05
  • vue實現(xiàn)書籍購物車功能

    vue實現(xiàn)書籍購物車功能

    這篇文章主要為大家詳細介紹了vue實現(xiàn)書籍購物車功能,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-10-10
  • vue 解決setTimeOut和setInterval函數(shù)無效報錯的問題

    vue 解決setTimeOut和setInterval函數(shù)無效報錯的問題

    這篇文章主要介紹了vue 解決setTimeOut和setInterval函數(shù)無效報錯的問題,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-07-07
  • vue觸發(fā)真實的點擊事件跟用戶行為一致問題

    vue觸發(fā)真實的點擊事件跟用戶行為一致問題

    這篇文章主要介紹了vue觸發(fā)真實的點擊事件跟用戶行為一致問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-03-03
  • vue使用自定義指令實現(xiàn)按鈕權(quán)限展示功能

    vue使用自定義指令實現(xiàn)按鈕權(quán)限展示功能

    這篇文章主要介紹了vue中使用自定義指令實現(xiàn)按鈕權(quán)限展示功能,本文結(jié)合實例代碼給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-04-04
  • vue路由傳參方式的方式總結(jié)及獲取參數(shù)詳解

    vue路由傳參方式的方式總結(jié)及獲取參數(shù)詳解

    vue 路由傳參的使用場景一般都是應(yīng)用在父路由跳轉(zhuǎn)到子路由時,攜帶參數(shù)跳轉(zhuǎn),下面這篇文章主要給大家介紹了關(guān)于vue路由傳參方式的方式總結(jié)及獲取參數(shù)的相關(guān)資料,文中通過實例代碼介紹的非常詳細,需要的朋友可以參考下
    2022-07-07
  • Element?table?上下移需求的實現(xiàn)

    Element?table?上下移需求的實現(xiàn)

    本文主要介紹了Element?table?上下移需求的實現(xiàn),文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2022-07-07

最新評論

石阡县| 盐源县| 崇明县| 台中县| 遂平县| 贵定县| 凭祥市| 磐安县| 财经| 东乡族自治县| 乌兰察布市| 永嘉县| 岫岩| 胶州市| 永泰县| 景宁| 准格尔旗| 册亨县| 定兴县| 吉安市| 咸阳市| 景东| 龙游县| 吉林市| 江西省| 呼伦贝尔市| 崇信县| 楚雄市| 偃师市| 阳谷县| 奉新县| 右玉县| 亚东县| 莫力| 阿瓦提县| 扎鲁特旗| 喀喇| 延安市| 龙州县| 南城县| 贺兰县|