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

vue實現(xiàn)鍵盤輸入支付密碼功能

 更新時間:2018年08月18日 16:31:48   作者:劍子  
這篇文章主要為大家詳細介紹了vue實現(xiàn)鍵盤輸入支付密碼功能,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了vue實現(xiàn)鍵盤輸入支付密碼功能的具體代碼,供大家參考,具體內容如下

支付密碼功能界面如下圖:

主要代碼如下:

<template>
 <div class="pay-tool">
  <div class="pay-tool-title border-bottom">
   <span class="icon icon-back" @click="backHandle"></span><strong>請輸入交易密碼</strong>
  </div>
  <div class="pay-tool-content">
   <div class="pay-tool-inputs">
    <div class="item" v-for="i in items"><span class="icon_dot" v-if="password[i]"></span></div>
   </div>
   <div class="pay-tool-link"><router-link class="link" to="/getP">忘記密碼?</router-link></div>
  </div>
  <div class="pay-tool-keyboard">
   <ul>
    <li @click="keyUpHandle($event)" v-for="val in keys">
     {{ val }}
    </li>
    <li class="del" @click="delHandle"><span class="icon-del"><</span></li>
   </ul>
  </div>
 </div>
</template>

<script>
 const keys = () => [1, 2, 3, 4, 5, 6, 7, 8, 9, '', 0]
 // let sendFlag = true // 防止重復發(fā)送密碼
 export default {
  data () {
   return {
    items: [0, 1, 2, 3, 4, 5],
    keys: keys(),
    password: []
   }
  },
  methods: {
   backHandle () {
    this.clearPasswordHandle() // 返回時清除password
    this.$emit('backFnc') // 返回上級
   },
   keyUpHandle (e) {
    let text = e.currentTarget.innerText
    let len = this.password.length
    if (!text || len >= 6) return
    this.password.push(text)
    this.ajaxData()
   },
   delHandle () {
    if (this.password.length <= 0) return false
    this.password.shift()
   },
   ajaxData () {
    if (this.password.length >= 6) {
     console.log(parseInt(this.password.join(' ').replace(/\s/g, '')))
    }
    return false
   },
   clearPasswordHandle: function () {
    this.password = []
   }
  }
 }
</script>

<style lang="less" scoped>
 .pay-tool {
  position: relative;
  height: 18.93333333rem;
  background-color: #fff;
  overflow: hidden;
  &-title {
   width: 100%;
   height: 2.08888888rem;
   padding: 0 0.8rem;
   line-height: 2.08888888rem;
   text-align: center;
   overflow: hidden;
   .icon {
    float: left;
    margin-top: 0.72222222rem;
   }
   strong {
    font-size: 0.8rem;
   }
  }
  &-content {
   .pay-tool-inputs {
    width: 14.46666666rem;
    height: 2.31111111rem;
    margin: 1.28888888rem auto 0;
    border: 1px solid #b9b9b9;
    border-radius: 0.26666666rem;
    box-shadow: 0 0 1px #e6e6e6;
    display: flex;
    .item {
     width: 16.66666666%;
     height: 2.31111111rem;
     border-right: 1px solid #b9b9b9;
     line-height: 2.31111111rem;
     text-align: center;
     &:last-child {
      border-right: none;
     }
     .icon_dot {
      display: inline-block;
      width: 0.51111111rem;
      height: 0.51111111rem;
      background: url("../../assets/images/icon_dot.png") no-repeat;
      background-size: cover;
     }
    }
   }
   .pay-tool-link {
    padding: 0.53333333rem 0.8rem 0;
    text-align: right;
    .link {
     font-size: 0.66666666rem;
     color: #3c8cfb;
    }
   }
  }
  .pay-tool-keyboard {
   position: absolute;
   left: 0;
   bottom: 0;
   width: 100%;
   ul {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    li {
     width: 33.3333%;
     height: 2.25442834rem;
     line-height: 2.25442834rem;
     text-align: center;
     border-right: 1px solid #aeaeae;
     border-bottom: 1px solid #aeaeae;
     font-size: 0.8rem;
     font-weight: bold;
     &:nth-child(1), &:nth-child(2), &:nth-child(3) {
      border-top: 1px solid #eee;
     }
     &:nth-child(3), &:nth-child(6), &:nth-child(9), &:nth-child(12) {
      border-right: none;
     }
     &:nth-child(10), &:nth-child(11), &:nth-child(12) {
      border-bottom: none;
     }
     &:nth-child(10), &:nth-child(12), &:active {
      background-color: #d1d4dd;
     }
     &:nth-child(12):active {
      background-color: #fff;
     }
    }
   }
  }
 }
</style>

注意:頁面使用rem布局,根html的font-size為45px。

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關文章

  • vue2如何獲取上頁的url地址

    vue2如何獲取上頁的url地址

    這篇文章主要介紹了vue2如何獲取上頁的url地址問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-03-03
  • vue中各選項及鉤子函數(shù)執(zhí)行順序詳解

    vue中各選項及鉤子函數(shù)執(zhí)行順序詳解

    今天小編就為大家分享一篇vue中各選項及鉤子函數(shù)執(zhí)行順序詳解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-08-08
  • vue3中遇到reactive響應式失效的問題記錄

    vue3中遇到reactive響應式失效的問題記錄

    這篇文章主要介紹了vue3中遇到reactive響應式失效的問題記錄,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-06-06
  • el-form resetFields無效和validate無效的可能原因及解決方法

    el-form resetFields無效和validate無效的可能原因及解決方法

    本文主要介紹了el-form resetFields無效和validate無效的可能原因及解決方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2022-08-08
  • vue測試環(huán)境打包與生產環(huán)境打包文件數(shù)量不一致解決方案

    vue測試環(huán)境打包與生產環(huán)境打包文件數(shù)量不一致解決方案

    這篇文章主要為大家介紹了vue測試環(huán)境打包與生產環(huán)境打包文件數(shù)量不一致的解決方案,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-05-05
  • nuxt中刷新頁面后防止store值丟失問題

    nuxt中刷新頁面后防止store值丟失問題

    這篇文章主要介紹了nuxt中刷新頁面后防止store值丟失問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2023-10-10
  • Vue3?實現(xiàn)驗證碼倒計時功能(刷新保持狀態(tài))

    Vue3?實現(xiàn)驗證碼倒計時功能(刷新保持狀態(tài))

    倒計時的運用場景是需要經常用到的,但是根據(jù)業(yè)務的不同,好比手機驗證碼或者是郵箱驗證碼之類的,即使用戶跳轉到其它頁面或者刷新,再次回到登錄也,驗證碼的倒計時也得保持狀態(tài),下面通過本文給大家分享Vue3?驗證碼倒計時功能實現(xiàn),感興趣的朋友一起看看吧
    2022-08-08
  • vue自定義封裝指令以及實際使用

    vue自定義封裝指令以及實際使用

    市面上大多數(shù)關于Vue.js自定義指令的文章都在講語法,很少講實際的應用場景和用例,下面這篇文章主要給大家介紹了關于vue自定義封裝指令以及實際使用的相關資料,需要的朋友可以參考下
    2022-01-01
  • 基于vue2.0動態(tài)組件及render詳解

    基于vue2.0動態(tài)組件及render詳解

    下面小編就為大家分享一篇基于vue2.0動態(tài)組件及render詳解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-03-03
  • vue-cli3.0.4中webpack的dist路徑如何修改

    vue-cli3.0.4中webpack的dist路徑如何修改

    這篇文章主要介紹了vue-cli3.0.4中webpack的dist路徑如何修改,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-04-04

最新評論

土默特右旗| 霸州市| 松桃| 海丰县| 柘荣县| 新乐市| 淮滨县| 基隆市| 绩溪县| 舞钢市| 耒阳市| 蒙山县| 民勤县| 东丰县| 辽源市| 靖宇县| 苏州市| 正镶白旗| 宁津县| 广宁县| 茶陵县| 凌云县| 松滋市| 镇远县| 成都市| 焦作市| 紫金县| 建阳市| 乳山市| 修水县| 大宁县| 古浪县| 乡城县| 姜堰市| 涞源县| 武隆县| 太和县| 莎车县| 宜黄县| 庐江县| 巴青县|