<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題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關鍵字專題關鍵字專題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
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        使用Bootstrap和Vue實現用戶信息的編輯刪除功能

        來源:懂視網 責編:小采 時間:2020-11-27 22:26:57
        文檔

        使用Bootstrap和Vue實現用戶信息的編輯刪除功能

        使用Bootstrap和Vue實現用戶信息的編輯刪除功能:使用Bootstrap實現簡單的布局,并結合Vue進行用戶信息的編輯刪除等功能,代碼如下 <!DOCTYPE html> <html> <head> <meta charset=utf-8> <title>用戶信息編輯</title> <lin
        推薦度:
        導讀使用Bootstrap和Vue實現用戶信息的編輯刪除功能:使用Bootstrap實現簡單的布局,并結合Vue進行用戶信息的編輯刪除等功能,代碼如下 <!DOCTYPE html> <html> <head> <meta charset=utf-8> <title>用戶信息編輯</title> <lin

        使用Bootstrap實現簡單的布局,并結合Vue進行用戶信息的編輯刪除等功能,代碼如下

        <!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>
         <div class="container">
         <form role="form">
         <div class="form-group">
         <label for="username">用戶名</label>
         <input type="text" name="username" class="form-control" placeholder="請輸入用戶名" v-model="username">
         </div>
         <div class="form-group">
         <label for="password">密碼</label>
         <input type="password" name="password" class="form-control" placeholder="請輸入密碼" v-model="password">
         </div>
         <div class="form-group">
         <button type="button" class="btn btn-primary" @click="add()">添加</button>
         <button type="reset" class="btn btn-danger">重置</button>
         </div>
         </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>
         <!-- 模態框 -->
         <div class="modal fade" id="myModal" role="dialog" tabindex="-1">
         <div class="modal-dialog">
         <div class="modal-content">
         <div class="modal-header">
         <button type="button" class="close" data-dismiss="modal"><span>×</span></button>
         <h4 class="modal-title text-danger">警告!</h4>
         </div>
         <div class="modal-body">
         <h4 class="text-center">確認刪除?</h4>
         </div>
         <div 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)">確認</button>
         </div>
         </div>
         </div>
         </div>
         </div>
        <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>

        實現效果如下,因為只是簡單的實現編輯刪除的功能,因此密碼就直接顯示在表格中,沒有進行加密顯示

        整體布局界面


        這是整體布局界面

        用戶信息編輯后添加

        用戶信息編輯后添加

        刪除數據

        刪除數據

        總結

        以上所述是小編給大家介紹的使用Bootstrap和Vue實現用戶信息的編輯刪除功能,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網站的支持!

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        使用Bootstrap和Vue實現用戶信息的編輯刪除功能

        使用Bootstrap和Vue實現用戶信息的編輯刪除功能:使用Bootstrap實現簡單的布局,并結合Vue進行用戶信息的編輯刪除等功能,代碼如下 <!DOCTYPE html> <html> <head> <meta charset=utf-8> <title>用戶信息編輯</title> <lin
        推薦度:
        標簽: 刪除 使用 VUE
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 中文字幕久精品免费视频| 香蕉视频在线免费看| 青青青国产在线观看免费网站 | 97无码免费人妻超级碰碰夜夜| 亚洲色欲www综合网| 99久久综合精品免费| 日产亚洲一区二区三区| 亚洲视频免费在线播放| 亚洲高清视频在线播放| 免费成人激情视频| 亚洲人AV在线无码影院观看| 国产V亚洲V天堂A无码| 三年片免费高清版| 久久久亚洲欧洲日产国码二区| 日韩插啊免费视频在线观看| 亚洲黄网在线观看| 四色在线精品免费观看| 国产精品亚洲va在线观看| 亚洲精品第一国产综合精品99 | 国产拍拍拍无码视频免费| 伊人久久综在合线亚洲2019| 免费视频爱爱太爽了| 亚洲小说图区综合在线| 亚洲AV成人精品日韩一区18p| 中国一级特黄高清免费的大片中国一级黄色片 | 免费国产黄网站在线观看视频| 亚洲大片免费观看| 国产男女猛烈无遮挡免费视频 | 区久久AAA片69亚洲| 99精品视频在线视频免费观看 | 亚洲综合色婷婷七月丁香| 性无码免费一区二区三区在线| 亚洲国产日韩在线成人蜜芽| 在线观看91精品国产不卡免费| 二级毛片免费观看全程| 亚洲人成在线播放网站岛国| 在线日韩av永久免费观看| 在线a亚洲v天堂网2018| 国产精品永久免费| 久久久久亚洲av无码专区| 国产一区二区三区在线免费观看 |