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

Vue+Bootstrap實(shí)現(xiàn)簡(jiǎn)易學(xué)生管理系統(tǒng)

 更新時(shí)間:2021年02月09日 14:10:10   作者:程序猿玖月柒  
這篇文章主要為大家詳細(xì)介紹了Vue+Bootstrap實(shí)現(xiàn)簡(jiǎn)易學(xué)生管理系統(tǒng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

利用vue和bootstrap做了一個(gè)比較簡(jiǎn)易的學(xué)生管理系統(tǒng),供大家參考,具體內(nèi)容如下

廢話不多說(shuō),先來(lái)看看效果圖

附上源代碼:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
 <meta charset="utf-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <title>學(xué)生管理系統(tǒng)</title>
 <link href="../public/css/bootstrap.min.css" rel="stylesheet">
 <link href="../public/css/style.css" rel="stylesheet">
 <style>
 .row>div{border: 1px solid #000;}
 .modal{display: block;opacity:1;top: 100px; overflow:visible;}
 </style>
</head>
<body>
 <div id="app">

 
 <div class="container">
 <table class="table table-striped">
  <caption>學(xué)生管理系統(tǒng)v1.0-展示學(xué)生</caption>
  <tr>
  <th>姓名</th>
  <th>年齡</th>
  <th>性別</th>
  <th>操作</th>
  </tr>
  <tr v-for="item,key in stuInfoArr">
  <td>{{item.name}}</td>
  <td>{{item.age}}</td>
  <td>{{item.gender}}</td>
  <td><button @click="showDialog(item.name,key)" class="btn btn-danger btn-xs" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">刪除</button></td>
  </tr>  
 </table>
 
 <hr>
 <hr>
 <hr>
 <form action="">
  <table class="table table-striped">
  <caption>添加學(xué)生信息</caption>
  <tr>
   <td>項(xiàng)目</td>
   <td>信息</td>
  </tr>
  <tr>
   <td>姓名</td>
   <td>
   <input v-model="stuName" type="text" class="form-control" id="stuname" placeholder="姓名" name="stuname">
   </td> 
  </tr>
  <tr>
   <td>年齡</td>
   <td>
   <input v-model="stuAge" type="text" class="form-control" id="stuage" placeholder="年齡" name="stuage">
   </td> 
  </tr>
  <tr>
   <td>性別</td>
   <td>
   <label class="gen-span"><input v-model="stuGender" type="radio" class="radio-info" name="gender" checked value="男"> 男</label>
   <label class="gen-span"><input v-model="stuGender" type="radio" class="radio-info" name="gender" value="女"> 女</label>
   <label class="gen-span"><input v-model="stuGender" type="radio" class="radio-info" name="gender" value="保密"> 保密</label>
   </td>
  </tr>
  </table>
  <div style="text-align: center;"><input type="button" class="btn btn-info btn-sm add-btn" value="確定增加" @click="add"/></div>
  </form>
 </div>
 <!-- 刪除按鈕確認(rèn)框 -->
 <div v-show="isDialogShow" class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
 <div class="modal-dialog" role="document">
  <div class="modal-content">
  <div class="modal-header">
  <button @click="isDialogShow=false" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  <h4 class="modal-title" id="exampleModalLabel">確認(rèn)框</h4>
  </div>
  <div class="modal-body">
  <form>
   <div class="form-group">
   <label for="message-text" class="control-label">確定要?jiǎng)h除<strong class="control-label-name" style="color:blue">{{delStuName}}</strong>嗎?</label>
  </div>
  </form>
  </div>
  <div class="modal-footer">
  <button type="button" class="btn btn-default" data-dismiss="modal" @click="isDialogShow=false">返回</button>
  <a href="###" rel="external nofollow" class="delete-a"><button type="button" class="btn btn-primary" @click="delStuInfo()">確認(rèn)</button></a>
  </div>
  </div>
 </div>
 </div>
 </div>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script> 
 new Vue({
 el: '#app',
 data: {
 stuInfoArr: [
 { name: '小明', age:12, gender:"男" },
 { name: '小紅', age:10, gender:"女" },
 { name: '小剛', age:16, gender:"保密" }
   ],
 isDialogShow: false,
 stuName: "",
 stuAge:"",
 stuGender:"男" ,
 delStuName:'xx',
 index: ""
   
 },
 methods:{
 add() {
 // 業(yè)務(wù)邏輯
 // 只要有一個(gè)為空就終止執(zhí)行
 if(!this.stuName || !this.stuAge) {
  alert("姓名和年齡不能為空")
  return 
 }
 this.stuInfoArr.push({ name:this.stuName , age:this.stuAge, gender:this.stuGender })
 },
 // 點(diǎn)擊刪除按鈕觸發(fā)的函數(shù)
 showDialog(name,key) {
 this.isDialogShow = true,
 this.delStuName = name,
 this.index = key
 },
 delStuInfo() {
 // 真正實(shí)現(xiàn)刪除功能
 this.stuInfoArr.splice(this.index, 1),
 this.isDialogShow = false
 }
 },   
 })
</script>
</body>
</html>

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

相關(guān)文章

  • vue中el-table表格的表頭操作代碼

    vue中el-table表格的表頭操作代碼

    本文通過(guò)實(shí)例代碼介紹對(duì)el-table表格的表頭操作方法,本文結(jié)合實(shí)例代碼給大家介紹的非常詳細(xì),感興趣的朋友跟隨小編一起看看吧
    2024-03-03
  • element中datepicker日期選擇器選擇周一到周日并實(shí)現(xiàn)上一周和下一周的方法

    element中datepicker日期選擇器選擇周一到周日并實(shí)現(xiàn)上一周和下一周的方法

    最近項(xiàng)目中需要用到日期選擇器,所以這里給大家總結(jié)下,這篇文章主要給大家介紹了關(guān)于element中datepicker日期選擇器選擇周一到周日并實(shí)現(xiàn)上一周和下一周的相關(guān)資料,需要的朋友可以參考下
    2023-09-09
  • vue+echarts實(shí)現(xiàn)動(dòng)態(tài)折線圖的方法與注意

    vue+echarts實(shí)現(xiàn)動(dòng)態(tài)折線圖的方法與注意

    這篇文章主要給大家介紹了關(guān)于vue+echarts實(shí)現(xiàn)動(dòng)態(tài)折線圖的方法與注意事項(xiàng),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-09-09
  • vue?懶加載組件chunk相對(duì)路徑混亂問(wèn)題及解決

    vue?懶加載組件chunk相對(duì)路徑混亂問(wèn)題及解決

    這篇文章主要介紹了vue?懶加載組件chunk相對(duì)路徑混亂問(wèn)題及解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-04-04
  • vue實(shí)現(xiàn)商城上貨組件簡(jiǎn)易版

    vue實(shí)現(xiàn)商城上貨組件簡(jiǎn)易版

    這篇文章主要為大家詳細(xì)介紹了vue實(shí)現(xiàn)商城上貨組件簡(jiǎn)易版,50行js代碼實(shí)現(xiàn)效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-11-11
  • Vue axios 將傳遞的json數(shù)據(jù)轉(zhuǎn)為form data的例子

    Vue axios 將傳遞的json數(shù)據(jù)轉(zhuǎn)為form data的例子

    今天小編就為大家分享一篇Vue axios 將傳遞的json數(shù)據(jù)轉(zhuǎn)為form data的例子,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2019-10-10
  • Vue Router history模式的配置方法及其原理

    Vue Router history模式的配置方法及其原理

    這篇文章主要介紹了Vue Router history模式的配置方法及其原理,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2019-05-05
  • vue實(shí)現(xiàn)tab欄點(diǎn)擊高亮效果

    vue實(shí)現(xiàn)tab欄點(diǎn)擊高亮效果

    這篇文章主要為大家詳細(xì)介紹了vue實(shí)現(xiàn)tab欄點(diǎn)擊高亮效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2020-08-08
  • Vue3中10多種組件通訊方法小結(jié)

    Vue3中10多種組件通訊方法小結(jié)

    本文主要介紹了Vue3中10多種組件通訊方法小結(jié),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2022-06-06
  • vue-cli腳手架build目錄下utils.js工具配置文件詳解

    vue-cli腳手架build目錄下utils.js工具配置文件詳解

    這篇文章主要介紹了vue-cli腳手架build目錄下utils.js工具配置文件詳解,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-09-09

最新評(píng)論