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

Vue實(shí)現(xiàn)6位數(shù)密碼效果

 更新時(shí)間:2018年08月18日 16:20:53   作者:Rkatsiteli  
這篇文章主要為大家詳細(xì)介紹了Vue實(shí)現(xiàn)6位數(shù)密碼,優(yōu)化iOS WebView卡頓,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

在ios系統(tǒng),原生 webview 嵌套H5頁面使用時(shí),編寫完成的6位數(shù)輸入密碼,輸入密碼卡頓問題的解決方案:

如下圖:

原因是因?yàn)椋珻SS 這塊 造成的。簡單來說,style left 為負(fù)數(shù)的時(shí)候出現(xiàn)的,android 目測不會出現(xiàn)此問題

input[type=tel] {
 opacity: 0;
 z-index: -1;
 position: absolute;
 left:-100%;
}

解決方案:

重新設(shè)置 input樣式問題

input[type=tel] {
 width: 0.1px;
 height: 0.1px;
 color: transparent;
 position: relative;
 top: 23px;
 background: #000000;
 left: 46px;
 border: none;
 font-size: 18px;
 opacity: 0;
 z-index: -1;
}

全部代碼在這,你可以拿出去使用即可

<template>
 <div id="payPwd">
  <header>支付密碼設(shè)置</header>
  <input ref="pwd" type="tel" maxlength="6" v-model="msg" class="pwd" unselectable="on" />
  <ul class="pwd-wrap" @click="focus">
   <li :class="msg.length == 0?'psd-blink':''"><i v-if="msg.length > 0"></i></li>
   <li :class="msg.length == 1?'psd-blink':''"><i v-if="msg.length > 1"></i></li>
   <li :class="msg.length == 2?'psd-blink':''"><i v-if="msg.length > 2"></i></li>
   <li :class="msg.length == 3?'psd-blink':''"><i v-if="msg.length > 3"></i></li>
   <li :class="msg.length == 4?'psd-blink':''"><i v-if="msg.length > 4"></i></li>
   <li :class="msg.length == 5?'psd-blink':''"><i v-if="msg.length > 5"></i></li>
  </ul>
  <button type="button" @click="sendCode">獲取驗(yàn)證碼 lodding</button>
 </div>
</template>
<script>
 import api from "./api";
 import "@/js/utils"; //公共方法
 export default {
  components: {},
  data() {
   return {
    msg: '',
   }
  },
  created() {},
  computed: {},
  watch: {
   msg(curVal) {
    if(/[^\d]/g.test(curVal)) {
     this.msg = this.msg.replace(/[^\d]/g, '');
    }
   },
  },
  methods: {
   focus() {
    this.$refs.pwd.focus();
   },
   sendCode() {
    //時(shí)間
    utils.sendCode(event.target);

    //showLoading
    utils.view.showLoading();

    setTimeout(function() {
     utils.view.dismissLoading();
    }, 5000);
   }
  },
  mounted() {}
 }
</script>
<style lang="less" scoped>
 #payPwd {
  height: auto;
  header {
   text-align: center;
   height: 80px;
   line-height: 90px;
   text-align: center;
  }
  input[type=tel] {
   width: 0.1px;
   height: 0.1px;
   color: transparent;
   position: relative;
   top: 23px;
   background: #000000;
   left: 46px;
   border: none;
   font-size: 18px;
   opacity: 0;
   z-index: -1;
  }
  //光標(biāo)
  .psd-blink {
   display: inline-block;
   background: url("./img/blink.gif") no-repeat center;
  }
  .pwd-wrap {
   width: 90%;
   height: 50px;
   padding-bottom: 1px;
   margin: 0 auto;
   background: #fff;
   border: 1px solid #ddd;
   display: flex;
   display: -webkit-box;
   display: -webkit-flex;
   cursor: pointer;
   position: absolute;
   left: 0;
   right: 0;
   top: 13%;
   z-index: 10;
   li {
    list-style-type: none;
    text-align: center;
    line-height: 50px;
    -webkit-box-flex: 1;
    flex: 1;
    -webkit-flex: 1;
    border-right: 1px solid #ddd;
    &:last-child {
     border-right: 0;
    }
    i {
     height: 10px;
     width: 10px;
     border-radius: 50%;
     background: #000;
     display: inline-block;
    }
   }
  }
  button {
   position: relative;
   display: block;
   height: 41px;
   text-align: center;
   margin: 0 auto;
   margin-top: 70%;
   padding: 0 20px;
   border-radius: 5px;
   font-size: 16px;
   border: 1px solid #dddddd;
   background: #dddddd;
   color: #000000;
  }
 }
</style>

附加:如果不想使用光標(biāo),直接

//去掉 :class="msg.length == 0?'psd-blink':''" 即可
<li><i v-if="msg.length > 0"></i></li>

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • vue實(shí)現(xiàn)用戶動態(tài)權(quán)限登錄的代碼示例

    vue實(shí)現(xiàn)用戶動態(tài)權(quán)限登錄的代碼示例

    這篇文章主要介紹了vue如何實(shí)現(xiàn)用戶動態(tài)權(quán)限登錄,文中的代碼示例介紹的非常詳細(xì),對大家學(xué)習(xí)vue有一定的幫助,需要的朋友可以參考閱讀
    2023-05-05
  • Vue+Microapp實(shí)現(xiàn)微前端的示例詳解

    Vue+Microapp實(shí)現(xiàn)微前端的示例詳解

    這篇文章主要為大家詳細(xì)介紹了如何實(shí)現(xiàn)以vite+vue3+Microapp為主應(yīng)用,以vue2+element為子應(yīng)用的微前端,感興趣的小伙伴快跟隨小編一起學(xué)習(xí)一下吧
    2023-06-06
  • vue.js路由跳轉(zhuǎn)詳解

    vue.js路由跳轉(zhuǎn)詳解

    這篇文章主要為大家詳細(xì)介紹了vue.js路由跳轉(zhuǎn)的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-08-08
  • 解決Vue不能檢測數(shù)組或?qū)ο笞儎拥膯栴}

    解決Vue不能檢測數(shù)組或?qū)ο笞儎拥膯栴}

    下面小編就為大家分享一篇解決Vue不能檢測數(shù)組或?qū)ο笞儎拥膯栴},具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-02-02
  • Vue中使用定時(shí)器(setInterval、setTimeout)的兩種方式

    Vue中使用定時(shí)器(setInterval、setTimeout)的兩種方式

    js中定時(shí)器有兩種,一個(gè)是循環(huán)執(zhí)行?setInterval,另一個(gè)是定時(shí)執(zhí)行?setTimeout,這篇文章主要介紹了Vue中使用定時(shí)器?(setInterval、setTimeout)的兩種方式,需要的朋友可以參考下
    2023-03-03
  • Vue打包后訪問靜態(tài)資源路徑問題

    Vue打包后訪問靜態(tài)資源路徑問題

    在本篇文章里小編給各位整理的是關(guān)于Vue打包后訪問靜態(tài)資源路徑問題相關(guān)知識點(diǎn),需要的朋友們學(xué)習(xí)下。
    2019-11-11
  • vue+Vue Router多級側(cè)導(dǎo)航切換路由(頁面)的實(shí)現(xiàn)代碼

    vue+Vue Router多級側(cè)導(dǎo)航切換路由(頁面)的實(shí)現(xiàn)代碼

    這篇文章主要介紹了vue+Vue Router多級側(cè)導(dǎo)航切換路由(頁面)的實(shí)現(xiàn)代碼,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-12-12
  • Vue?展示.md文件的方法詳解

    Vue?展示.md文件的方法詳解

    這篇文章主要介紹了Vue?展示.md文件的方法,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2023-05-05
  • 基于Vue3+Three.js實(shí)現(xiàn)一個(gè)3D模型可視化編輯系統(tǒng)

    基于Vue3+Three.js實(shí)現(xiàn)一個(gè)3D模型可視化編輯系統(tǒng)

    這篇文章主要介紹了基于Vue3+Three.js實(shí)現(xiàn)一個(gè)3D模型可視化編輯系統(tǒng),本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2023-09-09
  • Vue3.2?中新出的Expose用法一覽

    Vue3.2?中新出的Expose用法一覽

    這篇文章主要介紹了Vue3.2?中新出的?Expose?是做啥用的,新的expose方法是非常直觀的,而且很容易在我們的組件中實(shí)現(xiàn),本文給大家介紹的非常詳細(xì),需要的朋友可以參考下
    2022-07-07

最新評論

延川县| 宜良县| 余干县| 农安县| 双流县| 深州市| 扎赉特旗| 琼结县| 合阳县| 东安县| 城固县| 胶州市| 临桂县| 石嘴山市| 张家界市| 抚州市| 宁武县| 丰台区| 改则县| 诸暨市| 剑川县| 克东县| 筠连县| 榆树市| 昌平区| 家居| 中牟县| 门源| 石泉县| 芒康县| 洪雅县| 错那县| 凉城县| 金门县| 酒泉市| 怀化市| 鸡西市| 南汇区| 临海市| 绥江县| 从化市|