• <fieldset id="8imwq"><menu id="8imwq"></menu></fieldset>
  • <bdo id="8imwq"><input id="8imwq"></input></bdo>
    最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
    問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
    當(dāng)前位置: 首頁 - 科技 - 知識(shí)百科 - 正文

    Bootstrap與Vue操作用戶信息的添加與刪除

    來源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-27 19:54:36
    文檔

    Bootstrap與Vue操作用戶信息的添加與刪除

    Bootstrap與Vue操作用戶信息的添加與刪除:這次給大家?guī)鞡ootstrap與Vue操作用戶信息的添加與刪除,Bootstrap與Vue操作用戶信息添加與刪除的注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來看一下。<!DOCTYPE html> <html> <head> <meta charset=&quo
    推薦度:
    導(dǎo)讀Bootstrap與Vue操作用戶信息的添加與刪除:這次給大家?guī)鞡ootstrap與Vue操作用戶信息的添加與刪除,Bootstrap與Vue操作用戶信息添加與刪除的注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來看一下。<!DOCTYPE html> <html> <head> <meta charset=&quo

    這次給大家?guī)鞡ootstrap與Vue操作用戶信息的添加與刪除,Bootstrap與Vue操作用戶信息添加與刪除的注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來看一下。

    <!DOCTYPE html>
    <html>
    <head>
     <meta charset="utf-8">
     <title>用戶信息編輯</title>
     <link rel="stylesheet" type="text/css" href="bootstrap.min.css" rel="external nofollow" >
     <script type="text/javascript" src="jquery.js"></script>
     <script type="text/javascript" src="bootstrap.js"></script>
     <script type="text/javascript" src="vue.js"></script>
    </head>
    <body>
     <p class="container">
     <form role="form">
     <p class="form-group">
     <label for="username">用戶名</label>
     <input type="text" name="username" class="form-control" placeholder="請輸入用戶名" v-model="username">
     </p>
     <p class="form-group">
     <label for="password">密碼</label>
     <input type="password" name="password" class="form-control" placeholder="請輸入密碼" v-model="password">
     </p>
     <p class="form-group">
     <button type="button" class="btn btn-primary" @click="add()">添加</button>
     <button type="reset" class="btn btn-danger">重置</button>
     </p>
     </form>
     <hr>
     <table class="table table-bordered table-hover">
     <caption class="h3 text-info">用戶信息</caption>
     <tr>
     <th class="text-center">序號</th>
     <th class="text-center">用戶名</th>
     <th class="text-center">密碼</th>
     <th class="text-center">操作</th>
     </tr>
     <tr class="text-center" v-for="item in myData">
     <td>{{$index+1}}</td>
     <td>{{item.name}}</td>
     <td>{{item.password}}</td>
     <td>
     <button class="btn btn-danger" data-toggle="modal" data-target="#myModal" @click="nowIndex=$index">刪除</button>
     </td>
     </tr>
     <tr v-show="myData.length!=0">
     <td colspan="4" class="text-center">
     <button class="btn btn-danger" data-toggle="modal" data-target="#myModal" @click="nowIndex=-2">刪除全部</button>
     </td>
     </tr>
     <tr v-show="myData.length==0">
     <td colspan="4" class="text-center">
     <h5 class="text-muted">暫無信息...</h5>
     </td>
     </tr>
     </table>
     <!-- 模態(tài)框 -->
     <p class="modal fade" id="myModal" role="dialog" tabindex="-1">
     <p class="modal-dialog">
     <p class="modal-content">
     <p class="modal-header">
     <button type="button" class="close" data-dismiss="modal"><span>×</span></button>
     <h4 class="modal-title text-danger">警告!</h4>
     </p>
     <p class="modal-body">
     <h4 class="text-center">確認(rèn)刪除?</h4>
     </p>
     <p class="modal-footer">
     <button type="button" data-dismiss="modal" class="btn btn-primary">取消</button>
     <button type="button" data-dismiss="modal" class="btn btn-danger" @click="deleteMsg(nowIndex)">確認(rèn)</button>
     </p>
     </p>
     </p>
     </p>
     </p>
    <script type="text/javascript">
     new Vue({
     el: ".container",
     data: {
     myData:[],
     username:"",
     password:"",
     nowIndex:-100
     },
     methods:{
     add:function(){
     this.myData.push({
     name:this.username,
     password:this.password
     });
     this.username="";
     this.password="";
     },
     deleteMsg:function(n){
     if(n==-2){
     this.myData=[];
     }else{
     this.myData.splice(n,1);
     }
     }
     }
     });
    </script>
    </body>
    </html>

    實(shí)現(xiàn)效果如下,因?yàn)橹皇呛唵蔚膶?shí)現(xiàn)編輯刪除的功能,因此密碼就直接顯示在表格中,沒有進(jìn)行加密顯示

    相信看了本文案例你已經(jīng)掌握了方法,更多精彩請關(guān)注Gxl網(wǎng)其它相關(guān)文章!

    推薦閱讀:

    Angular操作表單增刪改查的驗(yàn)證功能

    源生JS怎樣實(shí)現(xiàn)文件異步上傳

    聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    Bootstrap與Vue操作用戶信息的添加與刪除

    Bootstrap與Vue操作用戶信息的添加與刪除:這次給大家?guī)鞡ootstrap與Vue操作用戶信息的添加與刪除,Bootstrap與Vue操作用戶信息添加與刪除的注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來看一下。<!DOCTYPE html> <html> <head> <meta charset=&quo
    推薦度:
    標(biāo)簽: 刪除 VUE 用戶信息
    • 熱門焦點(diǎn)

    最新推薦

    猜你喜歡

    熱門推薦

    專題
    Top
    主站蜘蛛池模板: 免费观看四虎精品成人| 精品一区二区三区无码免费视频| 亚洲精品偷拍视频免费观看| 2021年精品国产福利在线| 精品亚洲麻豆1区2区3区| 欧美精品福利在线视频| 2021国产成人精品久久| 2021国产成人精品国产| 亚洲AV无码久久精品色欲| 久久精品国产99久久香蕉| 欧美一区二区精品| 国产精品久久永久免费| 国内精品九九久久久精品| 亚洲国产另类久久久精品小说| 久久国产成人亚洲精品影院| 国产精品久操视频| 国产99精品一区二区三区免费| 欧美大片日韩精品| 国产精品亚洲片夜色在线| 99久久精品日本一区二区免费| 人妻熟妇乱又伦精品视频| 无码精品黑人一区二区三区| 一区二区日韩国产精品| 真实国产乱子伦精品一区二区三区| 日韩精品欧美亚洲| 人妻少妇看A偷人无码精品| 久久久精品久久久久久| 久久er国产精品免费观看8| 精品无码三级在线观看视频| 国产亚洲曝欧美不卡精品| 国产精品尹人在线观看| 国产福利精品视频自拍| 国产精品青青在线观看爽香蕉| 国产精品单位女同事在线| 国产精品热久久毛片| 国产三级精品三级| 久久精品国产精品亜洲毛片| 欧美精品VIDEOSEX极品| 在线精品无码字幕无码AV| 色欲国产麻豆一精品一AV一免费| 日韩精品乱码AV一区二区|