亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

基于vue 實(shí)現(xiàn)表單中password輸入的顯示與隱藏功能

 更新時(shí)間:2019年07月19日 16:47:54   作者:rachelch  
這篇文章主要介紹了vue 實(shí)現(xiàn)表單中password輸入的顯示與隱藏功能 ,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

實(shí)現(xiàn)效果:

點(diǎn)擊 “眼睛” 的時(shí)候顯示與隱藏

代碼:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link href="css/bootstrap.min.css" rel="external nofollow" rel="stylesheet">
  <script src="js/vue.js"></script>
  <title>Title</title>
  <style>
    #main{
      text-align: center;
      margin-top:60px;
    }
    input[type=text],input[type=password]{
      width:260px;
      height:28px;
      display: inline-block;
    }
    span{
      margin-left:-30px;
      cursor: pointer;
    }
    input[type=checkbox]{
      cursor: pointer;
      opacity: 0;
      margin-left:-18px;
      display: inline-block;
    }
  </style>
</head>
<body>
<div id="main">
    <input type="text" class="form-control" v-model="msg" v-if="checked">
    <input type="password" class="form-control" v-model="msg" v-else>
    <span class="glyphicon glyphicon-eye-open"></span>
    <input type="checkbox"  v-model="checked">
</div>
<script>
  new Vue({
    el:"#main",
    data:{
      msg:"",
      checked:false
    },
    methods:{
    }
  });
</script>
  <script src="js/jquery.min.js"></script>
  <script src="js/bootstrap.min.js"></script>
</body>
</html>

=====================================

登錄頁(yè)面input輸入密碼顯示與隱藏實(shí)現(xiàn):

效果(點(diǎn)擊顯示與隱藏進(jìn)行切換):

代碼:

<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <script src="js/vue.js"></script>
    <script src="js/vue-resource.js"></script>
    <style>
      body{
        background:white;
      }
      .main{
        padding-top:50px;width:95%;margin:0 auto;
      }
      .account{
        border-bottom:1px solid #dfdfdf;padding-top:28px;
      }
      .account input{
        border:none;font-size:14px;margin-bottom:5px;width:91.5%;height:44px;
      }
      .account i{
        width:14px;
        height:14px;
        line-height:14px;
        font-size:18px;
        display:inline-block;
        color:white;
        background:#cdcdcd;
        border-radius:50%;
        text-align:center;
        font-style:normal;
      }
      .account .psd{
        width:81.6%;
      }
      .account span{
        color:#bfbfbf;float:right;line-height:40px;
      }
    </style>
  </head>

  <body>
    <div id="login">
      <div class="main">
        <div class="account">
          <input type="password" placeholder="密碼" class="psd" v-model="psd" v-if="ifDisplay"/>
          <input type="text" placeholder="密碼" class="psd" v-model="psd" v-else/>
          <i v-show="psd" @click="clearPassword()">×</i>
          <span v-show="ifDisplay" @click="ifDisplay=!ifDisplay">隱藏</span>
          <span v-show="!ifDisplay" @click="ifDisplay=!ifDisplay">顯示</span>
        </div>
      </div>
    </div>
    <script type="text/javascript">
      var vm=new Vue({
        el:'#login',
        data:{
          username:'',
          psd:'',
          ifDisplay:false,
        },
        methods:{
          clearPassword:function(){
            this.psd='';
          },
        }
      })
    </script>
  </body>
</html>

總結(jié)

以上所述是小編給大家介紹的基于vue 實(shí)現(xiàn)表單中password輸入的顯示與隱藏功能,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
如果你覺(jué)得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!

相關(guān)文章

  • 理理Vue細(xì)節(jié)(推薦)

    理理Vue細(xì)節(jié)(推薦)

    這篇文章主要介紹了Vue細(xì)節(jié),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-04-04
  • Vue2中配置Cesium全過(guò)程

    Vue2中配置Cesium全過(guò)程

    這篇文章主要介紹了Vue2中配置Cesium全過(guò)程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-05-05
  • Vue實(shí)現(xiàn)輪播圖組件的封裝

    Vue實(shí)現(xiàn)輪播圖組件的封裝

    Vue輪播圖組件的封裝可通過(guò)封裝組件、使用插件、配置化等方式實(shí)現(xiàn),主要包括圖片預(yù)加載、定時(shí)輪播、無(wú)限滾動(dòng)、手勢(shì)滑動(dòng)、響應(yīng)式布局等功能,實(shí)現(xiàn)方式可使用Vue的生命周期函數(shù)、自定義事件、計(jì)算屬性等技術(shù)
    2023-04-04
  • 深入理解vue-class-component源碼閱讀

    深入理解vue-class-component源碼閱讀

    這篇文章主要介紹了深入理解vue-class-component源碼閱讀,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-02-02
  • 一起寫一個(gè)即插即用的Vue Loading插件實(shí)現(xiàn)

    一起寫一個(gè)即插即用的Vue Loading插件實(shí)現(xiàn)

    這篇文章主要介紹了一起寫一個(gè)即插即用的Vue Loading插件實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-10-10
  • 在vue中路由使用this.$router.go(-1)返回兩次問(wèn)題

    在vue中路由使用this.$router.go(-1)返回兩次問(wèn)題

    這篇文章主要介紹了在vue中路由使用this.$router.go(-1)返回兩次問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-12-12
  • 在Vue中進(jìn)行數(shù)據(jù)分頁(yè)的實(shí)現(xiàn)方法

    在Vue中進(jìn)行數(shù)據(jù)分頁(yè)的實(shí)現(xiàn)方法

    在前端開發(fā)中,數(shù)據(jù)分頁(yè)是一個(gè)常見(jiàn)的需求,特別是當(dāng)處理大量數(shù)據(jù)時(shí),Vue作為一款流行的JavaScript框架,提供了強(qiáng)大的工具和生態(tài)系統(tǒng)來(lái)實(shí)現(xiàn)數(shù)據(jù)分頁(yè),本文將介紹如何在Vue中進(jìn)行數(shù)據(jù)分頁(yè),以及如何設(shè)計(jì)一個(gè)通用的分頁(yè)組件,需要的朋友可以參考下
    2023-10-10
  • 使用vscode添加vue模板步驟示例

    使用vscode添加vue模板步驟示例

    這篇文章主要為大家介紹了vscode添加vue模板步驟示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-08-08
  • vue中計(jì)算屬性computed和普通屬性method的區(qū)別小結(jié)

    vue中計(jì)算屬性computed和普通屬性method的區(qū)別小結(jié)

    Vue.js中Computed和Methods是兩種常用的數(shù)據(jù)處理方式,本文主要介紹了vue中計(jì)算屬性computed和普通屬性method的區(qū)別小結(jié),具有一定的參考價(jià)值,感興趣的可以了解一下
    2024-06-06
  • vue如何使用AIlabel標(biāo)注組件

    vue如何使用AIlabel標(biāo)注組件

    這篇文章主要介紹了vue如何使用AIlabel標(biāo)注組件,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-04-04

最新評(píng)論